IdSMTP1
.
IOHandler:= IdIOHandlerSocket1;
IdIOHandlerSocket1
.
SocksInfo:= IdSocksInfo1;
IdIOHandlerSocket1
.
Open;
IdSocksInfo1
.
Host:=Edit1
.
Text;
IdSocksInfo1
.
Username:=Edit2
.
Text;
IdSocksInfo1
.
Password:=Edit3
.
Text;
IdSocksInfo1
.
Port:=strtoint(Edit4
.
Text);
IdIOHandlerSocket1
.
Connected;
if
ComboBox1
.
ItemIndex=
0
then
IdSocksInfo1
.
Authentication:=saUsernamePassword
else
if
ComboBox1
.
ItemIndex=
1
then
IdSocksInfo1
.
Authentication:=saNoAuthentication
else
IdSocksInfo1
.
Authentication:=saUsernamePassword;
if
ComboBox3
.
ItemIndex=
0
then
IdSocksInfo1
.
Version:=svNoSocks
else
if
ComboBox3
.
ItemIndex=
1
then
IdSocksInfo1
.
Version:=svSocks4
else
if
ComboBox3
.
ItemIndex=
2
then
IdSocksInfo1
.
Version:=svSocks4A
else
if
ComboBox3
.
ItemIndex=
3
then
IdSocksInfo1
.
Version:=svSocks5
else
IdSocksInfo1
.
Version:=svNoSocks;
IdSMTP1
.
Host:=Edit6
.
Text;
IdSMTP1
.
Port:=strtoint(Edit7
.
Text);
if
ComboBox2
.
ItemIndex=
0
then
IdSMTP1
.
AuthenticationType:=atLogin
else
if
ComboBox2
.
ItemIndex=
1
then
IdSMTP1
.
AuthenticationType:=atNone
else
IdSMTP1
.
AuthenticationType:=atLogin;
IdSMTP1
.
Username:=Edit9
.
Text;
IdSMTP1
.
Password:=Edit10
.
Text;
IdSMTP1
.
Socket
.
Connected;
IdSMTP1
.
Connect(strtoint(Edit11
.
Text));
IdMessage1
.
From
.
Address:=Edit12
.
Text;
IdMessage1
.
Sender
.
Address:=Edit13
.
Text;
IdMessage1
.
Recipients
.
EMailAddresses := Memo2
.
Lines
.
Text;
IdMessage1
.
Subject:=Edit15
.
Text;
IdMessage1
.
Body
.
Text:=Memo1
.
Text;
if
IdSMTP1
.
Connected=
True
then
IdSMTP1
.
Send(IdMessage1);
IdSMTP1
.
Disconnect;