var
...
begin
SSL:=TIdSSLIOHandlerSocketOpenSSL.Create;
SMTP:=TIdSMTP.Create();
MailMsg:=TIdMessage.Create();
Body:=TStringList.Create;
try
...
Server,Port,User,Pass Settings
...
Sender,Empfänger,Inhalt,Subject Settings
....
SMTP.IOHandler:=SSL;
SMTP.Host:=Server;
SMTP.Port:=Port;
SMTP.Username:=User;
SMTP.Password:=Pass;
SMTP.UseTLS:=utUseExplicitTLS;
SMTP.ConnectTimeout:=8000;
SMTP.ReadTimeout:=8000;
MailMsg.ContentType:='
text/html';
MailMsg.From.Text:=SendingAddy;
MailMsg.Sender.text:=MailMsg.From.Text;
MailMsg.Recipients.EMailAddresses:=EmpfaengerAddy;
MailMsg.Subject:=Subject;
MailMsg.Body.Clear;
MailMsg.Body:=Body;
SMTP.Connect;
SMTP.Send(MailMsg);
SMTP.Disconnect;
finally
SSL.Free;
SMTP.Free;
MailMsg.Free;
MapList.Free;
Body.Free;
end;
end;