Page 1 of 1
sending mail with gmail smtp
Posted: Fri Jul 15, 2022 3:12 pm
by loulou2522
I have a problem with GMAIL and the PUREBASIC e-mail module. Since May of this year it is no longer possible to send mail with a gmail account by selecting the option "Use less secure applications". Does anyone know how to bypass this security and be able to send mails with purebasic again?
Thanks in advance
I have a problem with GMAIL and the PUREBASIC e-mail module. Since May of this year it is no longer possible to send mail with a gmail account by selecting the option "Use less secure applications". Does anyone know how to bypass this security and be able to send mails with purbasic again?
Re: sending mail with gmail smtp
Posted: Fri Jul 15, 2022 3:36 pm
by jacdelad
Hi,
it will only work if you enable your application to use OAuth2.0. There's no OAuth2.0-Module for PureBasic available at the moment, and I think there will never be one...
Re: sending mail with gmail smtp
Posted: Fri Jul 15, 2022 3:37 pm
by Marc56us
I have a problem with GMAIL and the PUREBASIC e-mail module. Since May of this year it is no longer possible to send mail with a gmail account by selecting the option "Use less secure applications".[...]
Yes, Google has been warning of this change for several months.
To help keep your account secure, from May 30, 2022, Google no longer supports the use of third-party apps or devices which ask you to sign in to your Google Account using only your username and password.
https://support.google.com/accounts/ans ... 0255?hl=en
A solution:
Sign in with App Passwords
An App Password is a 16-digit passcode that gives a less secure app or device permission to access your Google Account....
https://support.google.com/accounts/answer/185833

But I don't know if this passcode just takes the name of the program or the fingerprint of the program. In which case it is not usable with a compiled program (checksum change every time.)

Re: sending mail with gmail smtp
Posted: Sat Jul 16, 2022 3:51 am
by BarryG
jacdelad wrote: Fri Jul 15, 2022 3:36 pmit will only work if you enable your application to use OAuth2.0
Not quite. Gmail
app passwords work, as Marc56us said. My app can send Gmails using app passwords and these PureBasic SMTP mail settings:
Code: Select all
Server: smtp.gmail.com
Flags: #PB_Mail_UseSSL
Port: 465
From: Your gmail address
Login: Your gmail address
Password: Your app password
Works like a charm.
Re: sending mail with gmail smtp
Posted: Sat Jul 16, 2022 6:57 am
by loulou2522
Hi Barry
Can you communicate
SELECT AN APPLICATION --> The name you use
SELECT A DEVICE --'> what device you use
Thanks in advance
Re: sending mail with gmail smtp
Posted: Sat Jul 16, 2022 7:05 am
by BarryG
When creating the app password, select "Other (custom name") for the app, and just type whatever you want. It's just a description. Then the "Generate" button will become enabled, and you click that the get the app password. This is the password you use in your PureBasic mail commands. You won't have to select a device when doing a custom name.

Re: sending mail with gmail smtp
Posted: Sat Jul 16, 2022 8:03 am
by loulou2522
Thanks BarryG
What you describe work perfectly. I will try to write your methos for all who want to send email via gmail.com
Re: sending mail with gmail smtp
Posted: Sat Jul 16, 2022 8:27 am
by jacdelad
BarryG wrote: Sat Jul 16, 2022 3:51 am
jacdelad wrote: Fri Jul 15, 2022 3:36 pmit will only work if you enable your application to use OAuth2.0
Not quite. Gmail
app passwords work, as Marc56us said. My app can send Gmails using app passwords and these PureBasic SMTP mail settings:
Code: Select all
Server: smtp.gmail.com
Flags: #PB_Mail_UseSSL
Port: 465
From: Your gmail address
Login: Your gmail address
Password: Your app password
Works like a charm.
Great, I didn't know that.
Re: sending mail with gmail smtp
Posted: Sat Jul 16, 2022 9:46 am
by BarryG
Glad I could help you both.