Hello,
I’ve followed the instructions in the module (Send_Photos_Email_NEW) and keep getting the following error message in the serial monitor:
>>>>>>>>>>>>>>>>>>>>
Connecting to WiFi….
SPIFFS mounted successfully
IP Address: http://192.168.1.109
Taking a photo…
Picture file name: /photo.jpg
The picture has been saved in /photo.jpg – Size: 0 bytes
Taking a photo…
Picture file name: /photo.jpg
The picture has been saved in /photo.jpg – Size: 0 bytes
Taking a photo…
Picture file name: /photo.jpg
The picture has been saved in /photo.jpg – Size: 112128 bytes
Connecting to SMTP server…
> C: ESP Mail Client v1.1.7
> C: connect to SMTP server
> C: host > smtp.gmail.com
> C: port > 465
> C: starting socket
> C: connecting to Server
> C: seeding the random number generator
> C: setting up the SSL/TLS structure
! W: Skipping SSL Verification. INSECURE!
> C: setting hostname for TLS session
> C: performing the SSL/TLS handshake
> C: verifying peer X.509 certificate
> C: smtp server connected
SMTP server connected, wait for greeting…
< S: 220 smtp.gmail.com ESMTP g11sm4019846edt.85 – gsmtp
Sending greeting response…
> C: send smtp command, HELO
< S: 250-smtp.gmail.com at your service, [84.194.137.56]
< S: 250-SIZE 35882577
< S: 250-8BITMIME
< S: 250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH
< S: 250-ENHANCEDSTATUSCODES
< S: 250-PIPELINING
< S: 250-CHUNKING
< S: 250 SMTPUTF8
Logging in…
> C: send smtp command, AUTH PLAIN
> C: espcamfrank@gmail.com
> C: espcamfrank@gmail.com **************
< S: 535-5.7.8 Username and Password not accepted. Learn more at
< S: 535 5.7.8 https://support.google.com/mail/?p=BadCredentials g11sm4019846edt.85 – gsmtp
Error, authentication failed
> E: authentication failed
> C: cleaning SSL connection
>>>>>>>>>>>>>>
I have tried both the “allow less secure apps” ON and OFF settings to no avail. The gmail account was created about an hour ago and I’m currently logged in (in a tab in my browser).
Except for the SSID & pwd and the mailaccount(s) and pwd, I have made no changes to the script.
Can you see what’s wrong. I’m at a loss.
Thanks in advance,
Frank
Hi Frank.
As you can see in the error log, it says, “< S: 535-5.7.8 Username and Password not accepted.”
It probably means that there is a mistake or on the email sender or the password.
Please double-check the sending email and corresponding password.
Regards,
Sara
Hi Sara,
Thanks for your reaction.
I copied & pasted the username and password from the sketch into the login screen for gmail and logged in without a problem. So those were correct.
Funny enough, I reran the sketch after making sure “allow less secure apps” was set, and it ran flawlessly. Go figure. The only thing I can think of is that I tried the sketch too soon after creating the account. It has happened in the past that it would take some time for a newly created mail account to “stabilize” and accept external commands.
Yesterday it wouldn’t allow the login except directly from the login screen, and I tried more than once. Today … no problems. Again… go figure.
Regards,
Frank