Forum > Networking and Web Programming

Sending email via SMTP using gmail

<< < (2/2)

Remy Lebeau:

--- Quote from: dseligo on May 13, 2022, 08:51:05 pm ---If you have 2-Step Verification turned on then you have to set App password for each application (you can't use main Google password).

--- End quote ---

OAuth is Google's preferred way.  The user logs in with their normal password, and are then given a token that is used during authentication.  Using an app-specific password is only needed for software that doesn't support OAuth.  Most modern email programs do support OAuth when accessing Gmail.  But lets say you are using an SMTP client written in Delphi/FreePascal, then you might need an app-password unless the client is updated to use OAuth instead.

Nicola Gorlandi:
Hi to all,

Up to now gmail do not accept anymore to switch off less secure app. Could you please give me some information about how to implement OAUTh for sendi email with gmail ? Many thanks

paweld:
https://forum.lazarus.freepascal.org/index.php/topic,59718.0.html

rvk:

--- Quote from: Nicola Gorlandi on July 03, 2022, 10:47:23 am ---Up to now gmail do not accept anymore to switch off less secure app. Could you please give me some information about how to implement OAUTh for sendi email with gmail ?

--- End quote ---
You don't really need OAuth2 for sending mail via Gmail.
You can just use app passwords.

First enable two factor authentication on your account and create an new App Password here
https://myaccount.google.com/security

Use that App Password instead of your normal password and it should work without any modifications.

Navigation

[0] Message Index

[*] Previous page

Go to full version