NamelessMC

Internet Explorer

Internet Explorer is not supported. Please upgrade to a more modern browser.

Question Gmail SMTP
Started by KitsuHG

KitsuHG

KitsuHG

Member
Joined
08 Jan 2023
Last Seen
01 Sep 2024
Topics
4
Posts
14

Hello everyone ! (And Samerton because I think It's you that you will give me anwser 😘)

I try to set up gmail SMTP server but the tutorial on the faq's is up to date (and the link too) and I don't find my error and why It's doesn't work.

 

I put that :

https://i.goopics.net/hwdpsk.png

And I have that when I try to send test email :

https://i.goopics.net/rztjly.png

 

KitsuHG · about 1 year ago
KitsuHG

KitsuHG

Member
Joined
08 Jan 2023
Last Seen
01 Sep 2024
Topics
4
Posts
14

Up ! :)

KitsuHG · about 1 year ago
Samerton

Samerton

Owner
Joined
30 Mar 2015
Last Seen
22 Nov 2024
Topics
41
Posts
1076

Hi,

To get a full email log, please edit the file core/classes/Core/Email.php in a text editor. Find the following line (line 109 using version 2.0.3):

$mail->SMTPDebug = SMTP::DEBUG_OFF;

Replace it with the following:

$mail->SMTPDebug = SMTP::DEBUG_LOWLEVEL;

Finally save and exit the file (and upload it back to your web host if necessary).

Then if you send a test email in the StaffCP -> Configuration -> Emails tab, you should see a full email log appear on screen with further information.

Samerton · about 1 year ago
KitsuHG

KitsuHG

Member
Joined
08 Jan 2023
Last Seen
01 Sep 2024
Topics
4
Posts
14
Samerton:

Hi,

To get a full email log, please edit the file core/classes/Core/Email.php in a text editor. Find the following line (line 109 using version 2.0.3):

$mail->SMTPDebug = SMTP::DEBUG_OFF;

Replace it with the following:

$mail->SMTPDebug = SMTP::DEBUG_LOWLEVEL;

Finally save and exit the file (and upload it back to your web host if necessary).

Then if you send a test email in the StaffCP -> Configuration -> Emails tab, you should see a full email log appear on screen with further information.

 

Logs :

 

Spoiler
2023-02-04 16:21:48 Connection: opening to smtp.gmail.com:587, timeout=15, options=array()
2023-02-04 16:21:48 Connection: opened
2023-02-04 16:21:48 SMTP INBOUND: "220 smtp.gmail.com ESMTP v17-20020aa7dbd1000000b004a249a97d84sm2686809edt.23 - gsmtp"
2023-02-04 16:21:48 SERVER -> CLIENT: 220 smtp.gmail.com ESMTP v17-20020aa7dbd1000000b004a249a97d84sm2686809edt.23 - gsmtp
2023-02-04 16:21:48 CLIENT -> SERVER: EHLO spring-craft.fr
2023-02-04 16:21:48 SMTP INBOUND: "250-smtp.gmail.com at your service, [146.59.9.53]"
2023-02-04 16:21:48 SMTP INBOUND: "250-SIZE 35882577"
2023-02-04 16:21:48 SMTP INBOUND: "250-8BITMIME"
2023-02-04 16:21:48 SMTP INBOUND: "250-STARTTLS"
2023-02-04 16:21:48 SMTP INBOUND: "250-ENHANCEDSTATUSCODES"
2023-02-04 16:21:48 SMTP INBOUND: "250-PIPELINING"
2023-02-04 16:21:48 SMTP INBOUND: "250-CHUNKING"
2023-02-04 16:21:48 SMTP INBOUND: "250 SMTPUTF8"
2023-02-04 16:21:48 SERVER -> CLIENT: 250-smtp.gmail.com at your service, [146.59.9.53]250-SIZE 35882577250-8BITMIME250-STARTTLS250-ENHANCEDSTATUSCODES250-PIPELINING250-CHUNKING250 SMTPUTF8
2023-02-04 16:21:48 CLIENT -> SERVER: STARTTLS
2023-02-04 16:21:48 SMTP INBOUND: "220 2.0.0 Ready to start TLS"
2023-02-04 16:21:48 SERVER -> CLIENT: 220 2.0.0 Ready to start TLS
2023-02-04 16:21:48 CLIENT -> SERVER: EHLO spring
2023-02-04 16:21:48 SMTP INBOUND: "250-smtp.gmail.com at your service, [146.59.9.53]"
2023-02-04 16:21:48 SMTP INBOUND: "250-SIZE 35882577"
2023-02-04 16:21:48 SMTP INBOUND: "250-8BITMIME"
2023-02-04 16:21:48 SMTP INBOUND: "250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH"
2023-02-04 16:21:48 SMTP INBOUND: "250-ENHANCEDSTATUSCODES"
2023-02-04 16:21:48 SMTP INBOUND: "250-PIPELINING"
2023-02-04 16:21:48 SMTP INBOUND: "250-CHUNKING"
2023-02-04 16:21:48 SMTP INBOUND: "250 SMTPUTF8"
2023-02-04 16:21:48 SERVER -> CLIENT: 250-smtp.gmail.com at your service, [146.59.9.53]250-SIZE 35882577250-8BITMIME250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH250-ENHANCEDSTATUSCODES250-PIPELINING250-CHUNKING250 SMTPUTF8
2023-02-04 16:21:48 Auth method requested: UNSPECIFIED
2023-02-04 16:21:48 Auth methods available on the server: LOGIN,PLAIN,XOAUTH2,PLAIN-CLIENTTOKEN,OAUTHBEARER,XOAUTH
2023-02-04 16:21:48 Requested auth method not available:
2023-02-04 16:21:48 Auth method selected: LOGIN
2023-02-04 16:21:48 CLIENT -> SERVER: AUTH LOGIN
2023-02-04 16:21:48 SMTP INBOUND: "334 VXNlcm5hbWU6"
2023-02-04 16:21:48 SERVER -> CLIENT: 334 VXNlcm5hbWU6
2023-02-04 16:21:48 CLIENT -> SERVER: c3ByaW5nY3JhZnQuY29udGFjdEBnbWFpbC5jb20=
2023-02-04 16:21:48 SMTP INBOUND: "334 UGFzc3dvcmQ6"
2023-02-04 16:21:48 SERVER -> CLIENT: 334 UGFzc3dvcmQ6
2023-02-04 16:21:48 CLIENT -> SERVER: c3ByaW5nYWRtaW5tYWlsMjI=
2023-02-04 16:21:48 SMTP INBOUND: "535-5.7.8 Username and Password not accepted. Learn more at"
2023-02-04 16:21:48 SMTP INBOUND: "535 5.7.8 https://support.google.com/mail/?p=BadCredentials v17-20020aa7dbd1000000b004a249a97d84sm2686809edt.23 - gsmtp"
2023-02-04 16:21:48 SERVER -> CLIENT: 535-5.7.8 Username and Password not accepted. Learn more at535 5.7.8 https://support.google.com/mail/?p=BadCredentials v17-20020aa7dbd1000000b004a249a97d84sm2686809edt.23 - gsmtp
2023-02-04 16:21:48 SMTP ERROR: Password command failed: 535-5.7.8 Username and Password not accepted. Learn more at535 5.7.8 https://support.google.com/mail/?p=BadCredentials v17-20020aa7dbd1000000b004a249a97d84sm2686809edt.23 - gsmtp
SMTP Error: Could not authenticate.
2023-02-04 16:21:48 CLIENT -> SERVER: QUIT
2023-02-04 16:21:48 SMTP INBOUND: "221 2.0.0 closing connection v17-20020aa7dbd1000000b004a249a97d84sm2686809edt.23 - gsmtp"
2023-02-04 16:21:48 SERVER -> CLIENT: 221 2.0.0 closing connection v17-20020aa7dbd1000000b004a249a97d84sm2686809edt.23 - gsmtp
2023-02-04 16:21:48 Connection: closed
SMTP Error: Could not authenticate.
KitsuHG · about 1 year ago · Last edited: about 1 year ago
Samerton

Samerton

Owner
Joined
30 Mar 2015
Last Seen
22 Nov 2024
Topics
41
Posts
1076

Hi,

Thanks for the log - Gmail has returned the error Username and Password not accepted, with a link to https://support.google.com/mail/?p=BadCredentials included.

I would recommend reading any tips provided by Google in the above link, and also to try using an app password if you are not already.

Samerton · about 1 year ago
KitsuHG

KitsuHG

Member
Joined
08 Jan 2023
Last Seen
01 Sep 2024
Topics
4
Posts
14

I read the subject of google but It's says that the functionnality is no longer accessible. What can I do for replacing gmail ? 

Because if I not use SMTP, people doesn't receved the email for the inscription.

KitsuHG · about 1 year ago
Samerton

Samerton

Owner
Joined
30 Mar 2015
Last Seen
22 Nov 2024
Topics
41
Posts
1076

There are SMTP providers out there like Sendgrid, but I have never used any of them - you can try searching online for some alternatives.

If you are using a web host, they usually have their own SMTP server which you can use.

Samerton · about 1 year ago
TwoTrusty

TwoTrusty

Member
Joined
08 Feb 2023
Last Seen
20 Mar 2023
Topics
0
Posts
1

If you're attempting to setup smtp with a google account the solution is to configure 2FA on your google account which will allow you to setup and add an app password (no google admin account required). That password is then used in place of your actual password in the email setting of your forums configuration settings. Depending on the theme you're using (if NEXUS), there will be more issues with email verification after correctly setting up smtp.

TwoTrusty · about 1 year ago