Link to home
Start Free TrialLog in
Avatar of LeTay
LeTay

asked on

SMTP error in Delphi using smtp.gmail.com

I have a Delphi application sending emails
There are two options
One is without SSL, the other with SSL
I use it without SSL when I am connected directly to my provider and it works fine.
I use it with SSL when using smtp.gmail.com and my gmail account
Since some time (don't know exactly when), the second (secured way) does not work anymore
The TidSMTP component get IOHandler := SSL and UseTLS := utUseImplicitTSL (not changed)
The TidSMTP.Connect works fine, but the TidSMTP.Send returns  this kind of error :

 <https://accounts.google.com/ContinueSignIn?sarp=1&scc=1&plt=AKgnsbvJR3L2SU43nXEvtrT1bF3WblPIxCyTedPLv74EwHHVmEBfjkVTZ5FqyrzOmo8tTjvt8Qf3DbqK2t04RXWr1GfgCQH_4BYSXonafvqrHNurjobytefQg691qDY0w9LGXfx3RehaxEtFqDDfae_dPctGre9i96NwOzQr7N5lO0dssUBA1UI-Ongs2KCJkQSTcUhvukPy21IqXNrdKZBX7VKz4i_RHP3wA6ASwdMkcZXLUFxjvG4> Please log in via your web browser and
then try again.
Learn more athttps://support.google.com/mail/answer/78754 m16sm2761947wmb.13 - gsmtp

The URL mentionned at the end returns unknown page
Avatar of ste5an
ste5an
Flag of Germany image

The URL https://support.google.com/mail/answer/78754 points to page explaining the security handshake for applications.

I'm not using gmail, but it is an authentication issue. Not SSL.
Gmail is using something called OAuth2 for logging in.  They are not very clear about that in their articles but that is what broke everyone's Gmail logins a few months ago.

https://developers.google.com/identity/protocols/OAuth2
Avatar of LeTay
LeTay

ASKER

So the question now is : is there a library or something similar that I can use in Delphi to authenticate connection to gmail smtp server ?
I don't know.  If you don't get a response, please click on "Request Attention" above to get others to look at your question.
Check if this question thread or this one - helps...
Avatar of LeTay

ASKER

This was the way I used it ... until it fails, due to the "new" authentication method used by Google.
Using "OAuth2" looks to be much more complex...
Using "OAuth2" looks to be much more complex...
I suspect it is.  It is one more attempt to keep 'hackers' from breaking into their accounts.
Avatar of LeTay

ASKER

I thought that SSL was strong enough...
No idea now how to use that OAuth2 easily
SSL/TLS encrypts communication.  OAuth2 has to do with authenticating your login.  I don't know how it works either.  They have links on those pages to show you how to use "less secure" login methods but they're not recommending them.
Avatar of LeTay

ASKER

Ok
Can you send me such link ?
Thanks
ASKER CERTIFIED SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of LeTay

ASKER

Well well