• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

ESP32-CAM Sending photo through email

Q&A Forum › Category: ESP32 › ESP32-CAM Sending photo through email
0 Vote Up Vote Down
Frank De Hert asked 4 years ago

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

3 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 4 years ago

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

0 Vote Up Vote Down
Frank De Hert answered 4 years ago

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 

0 Vote Up Vote Down
Sara Santos Staff answered 4 years ago

Hi Frank.
There is a weird behavior and very difficult to troubleshoot.
Meanwhile, let me know if you find anything new related to this issue.
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Learn LVGL: Build GUIs for ESP32 Projects – Version 1.5 July 7, 2025
  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.