• 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

SMTP email with ESP8266

Q&A Forum › Category: ESP8266 › SMTP email with ESP8266
0 Vote Up Vote Down
isaias.cipm asked 6 years ago

Hi, I want to send an email message from ESP8266 using the protocol SMTP. The ESP is into a factory site and want to send the message to my co-workers when an alarm is triggered. Is there some example code I can use it? Thanks.

9 Answers
0 Vote Up Vote Down
Rui Santos Staff answered 6 years ago

Hi, where’s the SMTP server located? (is it a local server or is it a cloud service) Which SMTP service do you plan to use?
thanks!

0 Vote Up Vote Down
isaias.cipm answered 6 years ago

Hi Rui, thanks. It is a local server managed by the IT guys in the company. Regarding which service I do not know the answer but I will ask this question to them. I only want to send an email message with SMTP from the ESP8266 to my coworkers when an alarm is triggered. Thanks!

0 Vote Up Vote Down
Rui Santos Staff answered 6 years ago

Hi again!

I was asking because if you just want to send an email, I recommend using the ESP with IFTTT.com. You can easily setup an account and send emails through their API with some simple HTTP client.

If you want to use a local SMTP server, it depends on the level of security (how you authenticate, if it has an SSL certificate, etc).

I think this example should work for you: https://www.electronicshub.org/send-an-email-using-esp8266/

I hope that helps and if you encounter a specific error let me know.

Thanks for your patience.
Rui

0 Vote Up Vote Down
isaias.cipm answered 6 years ago

Hi Rui,
Thanks a lot!  I will try it.
Best regards
Isaias
 

0 Vote Up Vote Down
Rui Santos Staff answered 6 years ago

Let me know your results.

0 Vote Up Vote Down
isaias.cipm answered 6 years ago

I tried the example and received the error message the sender is not allowed to send emails.Then I wend into the Google user account and enabled the Allowing Less Secure Apps. I tried again and didn’t work. I’m trying using another example and I will let you know.

0 Vote Up Vote Down
Rui Santos Staff answered 6 years ago

But can you use Gmail? I thought you wanted to use a local SMTP server… If you just want to send an email and you can use an online platform, I recommend using IFTTT.com

0 Vote Up Vote Down
isaias.cipm answered 6 years ago

Oh I got it. That’s why the examples are not working because I’m using Google Email account and trying using SMTP protocol, I’m testing at home. In fact, I created another gmail account and the same but now I know my error. Thanks. And yes, I tried using IFTTT and the ESP is able to send the email message to another Gmail account. Thank you very much for all your valuable help!!! In the future I will try using the SMTP local server. Thanks again!

0 Vote Up Vote Down
Rui Santos Staff answered 6 years ago

You’re welcome! I’m glad you were able to make it work. I’ll mark this post as resolved, feel free to ask more questions if you have them. 
Regards,
Rui

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

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 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.