Android Question SMTP logins to Gmail being blocked ... and quick solution

Andris

Active Member
Licensed User
Longtime User
This posting is not a question but more of a timesaving TIP ...

I have a couple of Android apps on the market (developed with B4A) that utilize SMTP to send emails via Google's Gmail server. Recently I was playing with one of them and was dismayed to find out that emails could no longer be sent because Google was rejecting the logins. To make a long story short, the problem was caused by Google going to a more sophisticated authentication procedure in recent(?) months, making simplistic legacy clients like my own apps fail to connect.

Short of redesigning the B4A client to match Gmail's new requirements, a customer can adjust his/her Gmail settings to allow the old authentication procedure and thus allow apps like mine to continue working (though it does make the login less secure). Here are Google's instructions:

You can switch to an app made by Google such as Gmail to access your account (recommended) or change your settings at https://www.google.com/settings/security/lesssecureapps so that your account is no longer protected by modern security standards.

To learn more, see https://support.google.com/accounts/answer/6010255.

Having said that, does anyone have a solution in B4A code that will make an app compatible with Gmail's newer authentication procedures?
 

Andris

Active Member
Licensed User
Longtime User
Are you using StartTLSMode?

:oops: In fact, the Net library used in those apps was v1.31. UseSSL was the only mode option then. So I have a feeling that upgrading Net and using StartTLSMode might do the trick :D ...

Thanks Erel for this even more useful tip!
 
Upvote 0

Peter Simpson

Expert
Licensed User
Longtime User
Are you using 2-Step verification @Mashiane?
If you're using Google's 2-Step verification then you need to setup an extra password for apps linking to your gmail account, just one extra password for gmail via apps and SMTP will start working again.

Well that's for if you're using 2-Step verification...
 
Last edited:
Upvote 0

Beja

Expert
Licensed User
Longtime User
I had the same issue with google and created a yahoo account.. now no problem.
 
Upvote 0
Top