Emailing

Ok so google have (I’ve just found out) said they will drop the insecure connection from end of September 2024.
And I use it! You know what it’s like if it ain’t broke don’t fix it.
But I’m being proactive for once as email sending from my apps are crucial for me to know what’s going on.

So question is: old code
’ Connect to Gmail
MailSocket.Address = “smtp.gmail.com
MailSocket.Port = 465
MailSocket.SSLConnectionType = SSLSocket.SSLConnectionTypes.TLSv1
MailSocket.SMTPConnectionMode = SMTPSecureSocket.SMTPConnectionTypes.SSLTLS
MailSocket.SSLEnabled = True

MailSocket.Username = “YourGmailUsername”
MailSocket.Password = “YourGmailPassword”

As far as I understand won’t connect anymore so what else is there to use!?

My code is invisible from the customer (they are aware it sends out emails) and I dont want to install an email app on the machine so where do I (WE) go from here

Any ideas or am I missing something!!! (Would not put it past me this week has been hell!!!)

Richard

You have to go onto your google account, and enable 2FA. Having done that there will be a place under Security where you can ask for an app-specific password. Then use that instead of your "YourGmailPassword’ and continue as before.

1 Like

Excellent thanks Tim

This presupposes that the process I outlined is not the one they’re now scrapping. What they were pushing a couple of years ago was OAUTH2, so if that is now what we have to use then i’m in the soup too.

Reading this, I wonder. Isn’t the option to use an application password still supported past October? I thought that it was an alternative to 2FA?

Google continues to make changes like these in an effort to shut down people violating their terms of service and using Gmail as a transactional email service.

If you don’t want to keep having to find workarounds every few months, consider finding a transactional email provider. Some have free tiers that will suffice for low volume sending. Every single one I’ve looked into recently has had SMTP support, so you don’t even have to change your code just the credentials.

5 Likes

Exactly. And your users should never ever have access to your Gmail password.

1 Like

No, you can’t get an app-specific password UNLESS you enable 2FA.

Yes, you are absolutely correct. I forgot that I did just that a while back. Getting old…

Besides, an application password is not a solution for use cases where the user of the application sends emails on their own behalf, as others mentioned earlier.

Not sure I understand what you mean. I have a gmail account, which I use via my email client here. It stopped working when they did away with the “allow-less-secure-apps” workaround. So that’s when I enabled 2FA and did the rest of the rigmarole I outlined above. That has worked ever since.

Yep. I read my second line and it does not make much sense this morning. Surely it was a brilliant idea at the time. Just don’t know now what it was. :wink: