This works for me with gmail using Synapse:
uses
..., smtpsend,ssl_openssl;
function SendMail(User, Password, MailFrom, MailTo, SMTPHost, SMTPPort: string; MailData: string
): Boolean;
var
SMTP: TSMTPSend;
sl:TStringList;
begin
Result:=False;
SMTP:=TSMTPSend.Create;
sl:=TStringList.Create;
try
sl.text:=Maildata;
SMTP.UserName:=User;
SMTP.Password:=Password;
SMTP.TargetHost:=SMTPHost;
SMTP.TargetPort:=SMTPPort;
SMTP.AutoTLS:=true;
if SMTPPort<> '25' then
SMTP.FullSSL:=true;
if SMTP.Login then
begin
result:=SMTP.MailFrom(MailFrom, Length(MailData)) and
SMTP.MailTo(MailTo) and
SMTP.MailData(sl);
SMTP.Logout;
end;
finally
SMTP.Free;
sl.Free;
end;
end;