Hi,
I thought that it's simply thing, use this code from link
https://wiki.freepascal.org/Synapse#Sending_email to send e-mail to my google account but something i can't or don't understand. So my code looks like (simplified)
function TForm1.SendMail(MailFrom, MailTo , MailData: string): Boolean;
var
SMTP: TSMTPSend;
sl:TStringList;
begin
Result:=False;
SMTP:=TSMTPSend.Create;
sl:=TStringList.Create;
try
sl.text:=Maildata;
SMTP.UserName:='myaccount@gmail.com';
SMTP.Password:='mypasswd';
SMTP.TargetHost:='smtp.gmail.com';
SMTP.TargetPort:='465';
SMTP.AutoTLS:=true;
SMTP.FullSSL:=true;
if SMTP.Login then
begin
result:=SMTP.MailFrom(MailFrom, Length(MailData)) and
SMTP.MailTo(MailTo) and
SMTP.MailData(sl);
SMTP.Logout;
showmessage('logged');
end;
finally
SMTP.Free;
sl.Free;
end;
end;
and button.OnClick looks like
SendMail('otheraddr@wp.pl', 'myaccount@gmail.com','122334');
In uses there are units smtpsend, ssl_openssl, openssl, opensslsockets;
I wonder if username is the same as 'myaccount@gmail.com' in my case?. But i get message 'logged' so I assume that it is. But nothing is received in thunderbird. Maybe someone has got similar problem with gmail. Other my account on different host works fine using similar code.
Regards,