I cannot connect to Gmail using SMTP with the last version of Synapse, using 
Lazarus 1.6 and Xubuntu 16.04.
The same code works perfectly with the email account of my domain (Pair).
I have installed libssl-dev and SSL works well with other email accounts.

This is my code
      smtp.TargetHost:='smtp.gmail.com';
      smtp.TargetPort:='465';
      smtp.AutoTLS:=true;
      smtp.FullSSL:=false;

I also tried with:
      smtp.AutoTLS:=false;
      smtp.FullSSL:=true;

and
      smtp.AutoTLS:=true;
      smtp.FullSSL:=true;

Also I tried with target port  567 and got the same bad results.

If AutoTLS:=true it is worse, I got this log:

SMTP ERROR: Login

20171210-131658.674 7FFFEFD148B0HR_SocketClose:
20171210-131658.674 7FFFEFD148B0HR_ResolvingBegin: smtp.gmail.com:465
20171210-131658.771 7FFFEFD148B0HR_ResolvingEnd: 173.194.68.108:465
20171210-131658.771 7FFFEFD148B0HR_SocketCreate: IPv4
20171210-131658.824 7FFFEFD148B0HR_Connect: smtp.gmail.com:465
20171210-131708.901 7FFFEFD148B0HR_CanRead:
20171210-131708.901 7FFFEFD148B0HR_Error: 104,Connection reset by peer
20171210-131708.901 7FFFEFD148B0HR_Error: 104,Connection reset by peer
The Message could not be sent

When I use AUtoSLL I get this log, it is better, but still is fails:

SMTP ERROR: MailFrom

20171210-131550.265 7FFFEFA4EB10HR_SocketClose:
20171210-131550.265 7FFFEFA4EB10HR_ResolvingBegin: smtp.gmail.com:465
20171210-131550.364 7FFFEFA4EB10HR_ResolvingEnd: 173.194.68.108:465
20171210-131550.364 7FFFEFA4EB10HR_SocketCreate: IPv4
20171210-131550.417 7FFFEFA4EB10HR_Connect: smtp.gmail.com:465
20171210-131550.658 7FFFEFA4EB10HR_CanRead:
20171210-131550.658 7FFFEFA4EB10HR_ReadCount: 54
20171210-131550.659 7FFFEFA4EB10<- 220 smtp.gmail.com ESMTP e204sm2934048qkb.25 
- gsmtp

20171210-131550.659 7FFFEFA4EB10-> EHLO xubudan

20171210-131550.659 7FFFEFA4EB10HR_WriteCount: 14
20171210-131550.720 7FFFEFA4EB10HR_CanRead:
20171210-131550.720 7FFFEFA4EB10HR_ReadCount: 222
20171210-131550.720 7FFFEFA4EB10<- 250-smtp.gmail.com at your service, 
[24.142.59.178]
250-SIZE 35882577
250-8BITMIME
250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-CHUNKING
250 SMTPUTF8

20171210-131550.720 7FFFEFA4EB10-> AUTH PLAIN 
AHpvY290cmFuQGdtYWlsLmNvbQBLQVY0N1NBZm1JQmhUSmpnd1EpVA==

20171210-131550.720 7FFFEFA4EB10HR_WriteCount: 69
20171210-131550.964 7FFFEFA4EB10HR_CanRead:
20171210-131550.965 7FFFEFA4EB10HR_ReadCount: 20
20171210-131550.965 7FFFEFA4EB10<- 235 2.7.0 Accepted

20171210-131550.965 7FFFEFA4EB10-> MAIL FROM:<"nnnnn" <xxx...@gmail.com>> 
SIZE=35

20171210-131550.965 7FFFEFA4EB10HR_WriteCount: 57
20171210-131551.018 7FFFEFA4EB10HR_CanRead:
20171210-131551.019 7FFFEFA4EB10HR_ReadCount: 53
20171210-131551.019 7FFFEFA4EB10<- 555 5.5.2 Syntax error. e204sm2934048qkb.25 
- gsmtp

The Message could not be sent

Do you have anyone managed to send email through Gmail SMTP?

Thanks in advance,
Daniel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
synalist-public mailing list
synalist-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synalist-public

Reply via email to