unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, Spin, Buttons, ComCtrls, IniFiles, MPlayer,
Registry;
type
TForm2 = class(TForm)
GroupBox1: TGroupBox;
Servers: TComboBox;
AddServer: TBitBtn;
DeleteServer: TBitBtn;
ServerName: TLabeledEdit;
ServerHost: TLabeledEdit;
ServerPort: TLabeledEdit;
ServerPOP3: TRadioButton;
ServerIMAP4: TRadioButton;
ServerUser: TLabeledEdit;
ServerPass: TLabeledEdit;
GroupBox3: TGroupBox;
Label3: TLabel;
UseProxy: TCheckBox;
ProxyType: TComboBox;
ProxyHost: TLabeledEdit;
ProxyPort: TLabeledEdit;
ProxyUser: TLabeledEdit;
ProxyPass: TLabeledEdit;
GroupBox2: TGroupBox;
Label1: TLabel;
Label2: TLabel;
Label4: TLabel;
Minimiz: TCheckBox;
Autorun: TCheckBox;
ShowTrayHints: TCheckBox;
PlaySounds: TCheckBox;
LoadMessageInTray: TCheckBox;
Interval: TSpinEdit;
Lang: TComboBox;
GroupBox4: TGroupBox;
Label5: TLabel;
Icon1: TImage;
LoadIcon1: TBitBtn;
StandartIcon1: TBitBtn;
Label6: TLabel;
Icon2: TImage;
LoadIcon2: TBitBtn;
StandartIcon2: TBitBtn;
Label7: TLabel;
SoundFile: TEdit;
PlaySound: TBitBtn;
LoadSound: TBitBtn;
StandartSound: TBitBtn;
Save: TBitBtn;
Cancel: TBitBtn;
ServerSSL: TCheckBox;
OpenDialog1: TOpenDialog;
OpenDialog2: TOpenDialog;
MediaPlayer1: TMediaPlayer;
StopSound: TBitBtn;
procedure FormCanResize(Sender: TObject; var NewWidth,
NewHeight: Integer; var Resize: Boolean);
procedure CancelClick(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure UseProxyClick(Sender: TObject);
procedure LoadIcon1Click(Sender: TObject);
procedure LoadIcon2Click(Sender: TObject);
procedure LoadSoundClick(Sender: TObject);
procedure DeleteServerClick(Sender: TObject);
procedure ServersChange(Sender: TObject);
procedure AddServerClick(Sender: TObject);
procedure ServersKeyPress(Sender: TObject; var Key: Char);
procedure FormCreate(Sender: TObject);
procedure LangChange(Sender: TObject);
procedure SaveClick(Sender: TObject);
procedure StandartIcon1Click(Sender: TObject);
procedure StandartIcon2Click(Sender: TObject);
procedure StandartSoundClick(Sender: TObject);
procedure PlaySoundClick(Sender: TObject);
procedure ServerIMAP4Click(Sender: TObject);
procedure ServerPOP3Click(Sender: TObject);
procedure ServerSSLClick(Sender: TObject);
procedure StopSoundClick(Sender: TObject);
private
public
procedure LoadLang(LngName:string);
procedure LoadServer(i:longint);
function implode(Sep:char;S:TStrings):string;
function encode(S:String):string;
end;
var
Form2: TForm2;
implementation
uses Unit1;
{$R *.dfm}
procedure TForm2.FormCanResize(Sender: TObject; var NewWidth,
NewHeight: Integer; var Resize: Boolean);
begin
Resize:=false;
end;
procedure TForm2.CancelClick(Sender: TObject);
begin
Form1.Servers.Email.Clear;
Form1.Servers.Email.AddStrings(Form1.ServersR.Email);
Form1.ServersR.Email.Free;
Form1.Servers.Host.Clear;
Form1.Servers.Host.AddStrings(Form1.ServersR.Host);
Form1.ServersR.Host.Free;
Form1.Servers.Port.Clear;
Form1.Servers.Port.AddStrings(Form1.ServersR.Port);
Form1.ServersR.Port.Free;
Form1.Servers.SType.Clear;
Form1.Servers.SType.AddStrings(Form1.ServersR.SType);
Form1.ServersR.SType.Free;
Form1.Servers.SSL.Clear;
Form1.Servers.SSL.AddStrings(Form1.ServersR.SSL);
Form1.ServersR.SSL.Free;
Form1.Servers.Username.Clear;
Form1.Servers.Username.AddStrings(Form1.ServersR.Username);
Form1.ServersR.Username.Free;
Form1.Servers.Password.Clear;
Form1.Servers.Password.AddStrings(Form1.ServersR.Password);
Form1.ServersR.Password.Free;
Form1.LoadMailBox;
Close;
end;
procedure TForm2.LoadLang(LngName:string);
var
ini:TINIFile;
begin
if(LngName<>'������� (�����������)') then begin
ini:=TINIFile.Create(Form1.ProgDir+'Languages\'+LngName);
//Buttons
Save.Caption:=ini.ReadString('Form2-GroupsAndButtons','BtnSave','���������');
Cancel.Caption:=ini.ReadString('Form2-GroupsAndButtons','BtnCancel','������');
//Group names
GroupBox1.Caption:=' '+ini.ReadString('Form2-GroupsAndButtons','Servers','������� �������� �����')+' ';
GroupBox3.Caption:=' '+ini.ReadString('Form2-GroupsAndButtons','Proxy','������ ������')+' ';
GroupBox2.Caption:=' '+ini.ReadString('Form2-GroupsAndButtons','Program','��������� ���������')+' ';
GroupBox4.Caption:=' '+ini.ReadString('Form2-GroupsAndButtons','IconsAndSounds','������ � �����')+' ';
//Form2-Server
ServerName.EditLabel.Caption:=ini.ReadString('Form2-Server','Email','������ ����������� �����');
ServerHost.EditLabel.Caption:=ini.ReadString('Form2-Server','Host','������ �������� �����');
ServerPort.EditLabel.Caption:=ini.ReadString('Form2-Server','Port','����');
ServerSSL.Caption:=ini.ReadString('Form2-Server','SSL','������������ ���������� ���������� (SSL)');
ServerUser.EditLabel.Caption:=ini.ReadString('Form2-Server','Username','��� ������������');
ServerPass.EditLabel.Caption:=ini.ReadString('Form2-Server','Password','������');
//Form2-Proxy
UseProxy.Caption:=ini.ReadString('Form2-Proxy','EnableProxy','������������ ������ ������');
Label3.Caption:=ini.ReadString('Form2-Proxy','Type','���')+':';
ProxyHost.EditLabel.Caption:=ini.ReadString('Form2-Proxy','Host','������ �������� �����');
ProxyPort.EditLabel.Caption:=ini.ReadString('Form2-Proxy','Port','����');
ProxyUser.EditLabel.Caption:=ini.ReadString('Form2-Proxy','Username','��� ������������');
ProxyPass.EditLabel.Caption:=ini.ReadString('Form2-Proxy','Password','������');
//Form2-Program
Label4.Caption:=ini.ReadString('Form2-Program','Language','����')+':';
Minimiz.Caption:=ini.ReadString('Form2-Program','MinimizedAtStart','�������������� ��� �������');
Autorun.Caption:=ini.ReadString('Form2-Program','AutorunWithWindwosStart','����������� ������ � Windows');
ShowTrayHints.Caption:=ini.ReadString('Form2-Program','ShowHints','���������� ����������� ��������� � ����');
PlaySounds.Caption:=ini.ReadString('Form2-Program','PlaySounds','�������� �����');
LoadMessageInTray.Caption:=ini.ReadString('Form2-Program','RetrMailIfProgramIsHide','��������� ��������� � ��������� ���������');
Label2.Caption:=ini.ReadString('Form2-Program','CheckMsgInterval','�������� �������� ���������')+':';
Label1.Caption:=ini.ReadString('Form2-Program','Minutes','���')+'.';
//Form2-IconsAndSounds
LoadIcon1.Caption:=ini.ReadString('Form2-IconsAndSounds','BtnChange','��������');
LoadIcon2.Caption:=LoadIcon1.Caption;
LoadSound.Caption:=LoadIcon1.Caption;
StandartIcon1.Caption:=ini.ReadString('Form2-IconsAndSounds','BtnStandard','�����������');
StandartIcon2.Caption:=StandartIcon1.Caption;
StandartSound.Caption:=StandartIcon1.Caption;
PlaySound.Caption:=ini.ReadString('Form2-IconsAndSounds','BtnPlay','�������������');
Label5.Caption:=ini.ReadString('Form2-IconsAndSounds','YouHaveNotNewMail','��� ����� �����');
Label6.Caption:=ini.ReadString('Form2-IconsAndSounds','YouHaveNewMail','���� ����� ������');
Label7.Caption:=ini.ReadString('Form2-IconsAndSounds','SoundIfYouHaveNewMail','�������, ���� ���� ����� ������');
ini.Free;
end;
end;
procedure TForm2.FormShow(Sender: TObject);
var
sr:TSearchRec;
begin
if((FileExists(Form1.ProgDir+'libeay32.dll'))and(FileExists(Form1.ProgDir+'ssleay32.dll'))) then
ServerSSL.Enabled:=true
else
ServerSSL.Enabled:=false;
Form1.ServersR.Email:=TStringList.Create;
Form1.ServersR.Email.AddStrings(Form1.Servers.Email);
Form1.ServersR.Host:=TStringList.Create;
Form1.ServersR.Host.AddStrings(Form1.Servers.Host);
Form1.ServersR.Port:=TStringList.Create;
Form1.ServersR.Port.AddStrings(Form1.Servers.Port);
Form1.ServersR.SType:=TStringList.Create;
Form1.ServersR.SType.AddStrings(Form1.Servers.SType);
Form1.ServersR.SSL:=TStringList.Create;
Form1.ServersR.SSL.AddStrings(Form1.Servers.SSL);
Form1.ServersR.Username:=TStringList.Create;
Form1.ServersR.Username.AddStrings(Form1.Servers.Username);
Form1.ServersR.Password:=TStringList.Create;
Form1.ServersR.Password.AddStrings(Form1.Servers.Password);
//Load servers
Servers.Clear;
Servers.Items.Add(Form1.LngLoad('AddNewServer','����� ������'));
Servers.Items.AddStrings(Form1.Servers.Email);
//Load proxy
UseProxy.Checked:=Form1.Op.UseProxy;
ProxyType.Text:=Form1.Op.ProxyType;
ProxyHost.Text:=Form1.Op.ProxyHost;
ProxyPort.Text:=Form1.Op.ProxyPort;
ProxyUser.Text:=Form1.Op.ProxyUsername;
ProxyPass.Text:=Form1.Op.ProxyPassword;
//Use proxy?
label3.Enabled:=UseProxy.Checked;
ProxyType.Enabled:=UseProxy.Checked;
ProxyHost.Enabled:=UseProxy.Checked;
ProxyPort.Enabled:=UseProxy.Checked;
ProxyUser.Enabled:=UseProxy.Checked;
ProxyPass.Enabled:=UseProxy.Checked;
//Load languages
Lang.Items.Clear;
Lang.Items.Add('������� (�����������)');
if(FindFirst(Form1.ProgDir+'Languages\*.lng',faAnyFile,sr)=0) then begin
repeat
if((sr.Attr and faAnyFile)=sr.Attr) then Lang.Items.Add(sr.Name);
until FindNext(sr)<>0;
FindClose(sr);
end;
//Load program settings
Lang.Text:=Form1.Op.Lang;
Minimiz.Checked:=Form1.Op.Minimized;
Autorun.Checked:=Form1.Op.Autorun;
ShowTrayHints.Checked:=Form1.Op.ShowHints;
PlaySounds.Checked:=Form1.Op.Sounds;
LoadMessageInTray.Checked:=Form1.Op.RetrieveIfMinimized;
Interval.Value:=Form1.Op.Interval;
Icon1.Picture.LoadFromFile(Form1.Op.IconNotNewMail);
Icon2.Picture.LoadFromFile(Form1.Op.IconNewMail);
SoundFile.Text:=Form1.Op.SoundYouHaveMail;
end;
procedure TForm2.UseProxyClick(Sender: TObject);
begin
label3.Enabled:=UseProxy.Checked;
ProxyType.Enabled:=UseProxy.Checked;
ProxyHost.Enabled:=UseProxy.Checked;
ProxyPort.Enabled:=UseProxy.Checked;
ProxyUser.Enabled:=UseProxy.Checked;
ProxyPass.Enabled:=UseProxy.Checked;
end;
procedure TForm2.LoadIcon1Click(Sender: TObject);
begin
if(OpenDialog1.Execute) then begin
Form1.Op.IconNotNewMail:=OpenDialog1.FileName;
Icon1.Picture.LoadFromFile(Form1.Op.IconNotNewMail);
end;
end;
procedure TForm2.LoadIcon2Click(Sender: TObject);
begin
if(OpenDialog1.Execute) then begin
Form1.Op.IconNewMail:=OpenDialog1.FileName;
Icon1.Picture.LoadFromFile(Form1.Op.IconNewMail);
end;
end;
procedure TForm2.LoadSoundClick(Sender: TObject);
begin
if(OpenDialog2.Execute) then begin
Form1.Op.SoundYouHaveMail:=OpenDialog2.FileName;
SoundFile.Text:=Form1.Op.SoundYouHaveMail;
end;
end;
procedure TForm2.LoadServer(i:longint);
begin
ServerName.Text:='';
ServerHost.Text:='';
ServerPort.Text:='110';
ServerPOP3.Checked:=true;
ServerIMAP4.Checked:=false;
ServerSSL.Checked:=false;
ServerUser.Text:='';
ServerPass.Text:='';
if(i>=1) then begin
dec(i);
ServerName.Text:=Form1.Servers.Email.Strings[i];
ServerHost.Text:=Form1.Servers.Host.Strings[i];
ServerPort.Text:=Form1.Servers.Port.Strings[i];
ServerPOP3.Checked:=Form1.Servers.SType.Strings[i]='0';
ServerIMAP4.Checked:=Form1.Servers.SType.Strings[i]='1';
ServerSSL.Checked:=Form1.Servers.SSL.Strings[i]='true';
ServerUser.Text:=Form1.Servers.Username.Strings[i];
ServerPass.Text:=Form1.Servers.Password.Strings[i];
end;
end;
procedure TForm2.DeleteServerClick(Sender: TObject);
begin
if(Servers.ItemIndex>=1) then begin
if(MessageDlg(Form1.LngLoad('promtDeleteEmail','�� ������������� ������ ������� ���� ������?'),mtConfirmation,[mbYes,mbNo],0)=mrYes) then begin
Form1.Servers.Email.Delete(Servers.ItemIndex-1);
Form1.Servers.Host.Delete(Servers.ItemIndex-1);
Form1.Servers.Port.Delete(Servers.ItemIndex-1);
Form1.Servers.SType.Delete(Servers.ItemIndex-1);
Form1.Servers.SSL.Delete(Servers.ItemIndex-1);
Form1.Servers.Username.Delete(Servers.ItemIndex-1);
Form1.Servers.Password.Delete(Servers.ItemIndex-1);
Form1.MailBox.Items.Delete(Servers.ItemIndex);
Servers.Items.Delete(Servers.ItemIndex);
LoadServer(-1);
end;
end;
end;
procedure TForm2.ServersChange(Sender: TObject);
begin
LoadServer(Servers.ItemIndex);
end;
procedure TForm2.AddServerClick(Sender: TObject);
var
s:string;
n,i:longint;
allfields:boolean;
begin
allfields:=(ServerName.Text<>'')and(ServerHost.Text<>'')and(ServerPort.Text<>'')and(ServerUser.Text<>'')and(ServerPass.Text<>'');
if(allfields) then begin
if(Servers.ItemIndex<1) then begin
Form1.Servers.Email.Add(ServerName.Text);
Form1.Servers.Host.Add(ServerHost.Text);
Form1.Servers.Port.Add(ServerPort.Text);
s:='0';
if(ServerPOP3.Checked) then s:='0'
else if(ServerIMAP4.Checked) then s:='1';
Form1.Servers.SType.Add(s);
s:='false'; if(ServerSSL.Checked) then s:='true';
Form1.Servers.SSL.Add(s);
Form1.Servers.Username.Add(ServerUser.Text);
Form1.Servers.Password.Add(ServerPass.Text);
Form1.MailBox.Items.Add(ServerName.Text);
i:=Servers.Items.Add(ServerName.Text);
Servers.ItemIndex:=i;
LoadServer(i);
end else
if(MessageDlg(Form1.LngLoad('promtErrorExistEmail','�� ������������� ������ �������� ������������ ������?'),mtConfirmation,[mbYes,mbNo],0)=mrYes) then begin
n:=Servers.ItemIndex-1;
Form1.Servers.Email.Strings[n]:=ServerName.Text;
Form1.Servers.Host.Strings[n]:=ServerHost.Text;
Form1.Servers.Port.Strings[n]:=ServerPort.Text;
s:='0';
if(ServerPOP3.Checked) then s:='0'
else if(ServerIMAP4.Checked) then s:='1';
Form1.Servers.SType.Strings[n]:=s;
s:='false'; if(ServerSSL.Checked) then s:='true';
Form1.Servers.SSL.Strings[n]:=s;
Form1.Servers.Username.Strings[n]:=ServerUser.Text;
Form1.Servers.Password.Strings[n]:=ServerPass.Text;
Form1.MailBox.Items.Strings[n+1]:=ServerName.Text;
Servers.Items.Strings[n+1]:=ServerName.Text;
Servers.ItemIndex:=n+1;
end;
end else
MessageDlg(Form1.LngLoad('ErrorNotFilledForm','��������� ��� ����'),mtError,[mbOK],0);
end;
procedure TForm2.ServersKeyPress(Sender: TObject; var Key: Char);
begin
Key:=#0;
end;
procedure TForm2.FormCreate(Sender: TObject);
begin
//Load lang
LoadLang(Form1.Op.Lang);
end;
procedure TForm2.LangChange(Sender: TObject);
begin
MessageDlg(Form1.LngLoad('NeedRestart','���������� ������������� ���������'),mtInformation,[mbOK],0);
end;
function TForm2.implode(Sep:char;S:TStrings):string;
var i:longint;
begin
result:='';
for i:=0 to S.Count-1 do
result:=result+S.Strings[i]+Sep;
end;
const pw=#48#50#58#91#67#115#100#99#86#83#100#121#82#47;
function TForm2.encode(S:String):string;
var
salt,saltchar,pw1:string;
saltcharcount,i:longint;
begin
if(length(S)>0) then begin
for i:=1 to length(pw) do pw1:=pw1+chr(ord(pw[i]) xor i);
//saltchar:='1234567890qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM';
saltchar:='';
for i:=0 to 9 do saltchar:=saltchar+chr(i+ord('0'));
for i:=ord('a') to ord('z') do saltchar:=saltchar+chr(i);
for i:=ord('A') to ord('Z') do saltchar:=saltchar+chr(i);
saltcharcount:=length(saltchar)-1;
randomize;
salt:=saltchar[random(saltcharcount)+1]+saltchar[random(saltcharcount)+1]+saltchar[random(saltcharcount)+1];
form1.LbBlowfish1.GenerateKey(salt+pw);
result:=salt+form1.LbBlowfish1.EncryptString(S);
end else
result:=s;
end;
procedure TForm2.SaveClick(Sender: TObject);
var
ini:TINIFile;
reg:tregistry;
begin
Form1.ServersR.Email.Free;
Form1.ServersR.Host.Free;
Form1.ServersR.Port.Free;
Form1.ServersR.SType.Free;
Form1.ServersR.SSL.Free;
Form1.ServersR.Username.Free;
Form1.ServersR.Password.Free;
ini:=TINIFile.Create(ChangeFileExt(Application.ExeName,'.ini'));
//Servers
ini.WriteString('Servers','Email',encode(implode('|',Form1.Servers.Email)));
ini.WriteString('Servers','Host',encode(implode('|',Form1.Servers.Host)));
ini.WriteString('Servers','Port',encode(implode('|',Form1.Servers.Port)));
ini.WriteString('Servers','SType',encode(implode('|',Form1.Servers.SType)));
ini.WriteString('Servers','SSL',encode(implode('|',Form1.Servers.SSL)));
ini.WriteString('Servers','Username',encode(implode('|',Form1.Servers.Username)));
ini.WriteString('Servers','Password',encode(implode('|',Form1.Servers.Password)));
//Proxy
Form1.Op.UseProxy:=UseProxy.Checked;
ini.WriteBool('Proxy','Enable',Form1.Op.UseProxy);
Form1.Op.ProxyType:=ProxyType.Text;
ini.WriteString('Proxy','Type',Form1.Op.ProxyType);
Form1.Op.ProxyHost:=ProxyHost.Text;
ini.WriteString('Proxy','Host',Form1.Op.ProxyHost);
Form1.Op.ProxyPort:=ProxyPort.Text;
ini.WriteString('Proxy','Port',Form1.Op.ProxyPort);
Form1.Op.ProxyUsername:=ProxyUser.Text;
ini.WriteString('Proxy','Username',Form1.Op.ProxyUsername);
Form1.Op.ProxyPassword:=ProxyPass.Text;
ini.WriteString('Proxy','Password',Form1.Op.ProxyPassword);
//Program
Form1.Op.Lang:=Lang.Text;
ini.WriteString('Program','Language',Form1.Op.Lang);
Form1.Op.Minimized:=Minimiz.Checked;
ini.WriteBool('Program','Minimized',Form1.Op.Minimized);
Form1.Op.Autorun:=Autorun.Checked;
ini.WriteBool('Program','Autorun',Form1.Op.Autorun);
Form1.Op.ShowHints:=ShowTrayHints.Checked;
ini.WriteBool('Program','ShowHints',Form1.Op.ShowHints);
Form1.Op.Sounds:=PlaySounds.Checked;
ini.WriteBool('Program','Sounds',Form1.Op.Sounds);
Form1.Op.RetrieveIfMinimized:=LoadMessageInTray.Checked;
ini.WriteBool('Program','RetrieveIfMinimized',Form1.Op.RetrieveIfMinimized);
Form1.Op.Interval:=Interval.Value;
ini.WriteInteger('Program','Interval',Form1.Op.Interval);
//Do Settings
//Interval
Form1.Timer1.Enabled:=false;
Form1.Timer1.Interval:=Form1.Op.Interval*60000;
Form1.Timer1.Enabled:=true;
//Registry
reg:=tregistry.Create;
if(Form1.Op.Autorun) then begin
try
if(reg.OpenKey('\Software\Microsoft\Windows\CurrentVersion\Run',True)) then begin
reg.WriteString(application.Title,'"'+paramstr(0)+'"');
reg.CloseKey;
end;
finally
reg.Free;
inherited;
end;
end else begin
try
if(reg.OpenKey('\Software\Microsoft\Windows\CurrentVersion\Run',true)) then begin
reg.DeleteValue(application.Title);
reg.CloseKey;
end;
finally
reg.Free;
inherited;
end;
end;
//Icons and sounds
ini.WriteString('Program','IconNotNewMail',Form1.Op.IconNotNewMail);
ini.WriteString('Program','IconNewMail',Form1.Op.IconNewMail);
ini.WriteString('Program','SoundYouHaveMail',Form1.Op.SoundYouHaveMail);
ini.Free;
Close;
end;
procedure TForm2.StandartIcon1Click(Sender: TObject);
begin
Form1.Op.IconNotNewMail:='Icons\notmail.ico';
Icon1.Picture.LoadFromFile(Form1.Op.IconNotNewMail);
end;
procedure TForm2.StandartIcon2Click(Sender: TObject);
begin
Form1.Op.IconNewMail:='Icons\mail.ico';
Icon2.Picture.LoadFromFile(Form1.Op.IconNewMail);
end;
procedure TForm2.StandartSoundClick(Sender: TObject);
begin
Form1.Op.SoundYouHaveMail:='Sounds\youhavemail.wav';
SoundFile.Text:=Form1.Op.SoundYouHaveMail;
end;
procedure TForm2.PlaySoundClick(Sender: TObject);
var tmp:string;
begin
Form1.MediaPlayer1.FileName:=SoundFile.Text;
Form1.MediaPlayer1.Open;
Form1.MediaPlayer1.Play;
end;
procedure TForm2.ServerIMAP4Click(Sender: TObject);
begin
ServerPort.Text:='143';
end;
procedure TForm2.ServerPOP3Click(Sender: TObject);
begin
if(ServerSSL.Checked) then
ServerPort.Text:='995'
else
ServerPort.Text:='110';
end;
procedure TForm2.ServerSSLClick(Sender: TObject);
begin
if(ServerSSL.Checked) then
ServerPort.Text:='995'
else begin
if(ServerPOP3.Checked) then ServerPort.Text:='110'
else
if(ServerIMAP4.Checked) then ServerPort.Text:='143';
end;
end;
procedure TForm2.StopSoundClick(Sender: TObject);
begin
Form1.MediaPlayer1.Stop;
end;
end.