How to send a e-mail (ESP32-Arduino)
How to send a e-mail (ESP32-Arduino)
On my project i need to send a e-mail when something happens, i dunno how to do it and i couldn't found documentation about that, can you guys help me?
-
- Posts: 90
- Joined: Sun Jul 02, 2017 3:38 am
Re: How to send a e-mail (ESP32-Arduino)
Email is sent using the SMTP protocol. There are libraries and examples, and the basic protocol isn't too difficult to implement.
But it's not that simple, most SMTP servers won't accept mail from a simple SMTP client implementation. They require authentication and TLS encryption. That makes it harder.
Probably better to use MQTT, and let a cloud-based MQTT broker handle sending email.
But it's not that simple, most SMTP servers won't accept mail from a simple SMTP client implementation. They require authentication and TLS encryption. That makes it harder.
Probably better to use MQTT, and let a cloud-based MQTT broker handle sending email.
Re: How to send a e-mail (ESP32-Arduino)
Alternatively, look at ifttt.com webhooks (previously known as maker channel). Send a trigger using http GET or POST from the ESP. TLS is optional. The HTTPClient library is helpful for this. When IFTTT receives the trigger, it can send email, SMS, tweet, etc.
-
- Posts: 3
- Joined: Sun Jul 30, 2017 7:17 am
Re: How to send a e-mail (ESP32-Arduino)
Hi there, I have used http://smtp2go.com to send emails from the ESP's, look through here....
https://github.com/EnvironmentMonitor/E ... -Gmail.ino
https://github.com/EnvironmentMonitor/E ... -Gmail.ino
Re: How to send a e-mail (ESP32-Arduino)
Hello all
A very nice solution exists:
Use this library:
[url][/https://github.com/gpepe/esp8266-sendemail]
And this program:
A very nice solution exists:
Use this library:
[url][/https://github.com/gpepe/esp8266-sendemail]
And this program:
Code: Select all
[/
#include <WiFi.h>
#include <sendemail.h>
/*
* to enable/disable debug on Serial: Please see sendemail.h
*
*/
const char* SSID = "------";
const char* PASS = "----------";
void setup()
{
Serial.begin(115200);
delay(10);
Serial.println("");
Serial.print("Connecting To ");
WiFi.begin(SSID, PASS);
while (WiFi.status() != WL_CONNECTED)
{
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi Connected");
Serial.print("IP address: ");
Serial.println(WiFi.localIP());
// create object
SendEmail e("smtp.gmail.com", 465, "email_account@gmail.com", "password", 5000, true);
// Send Email
e.send("<email_account@gmail.com>", "<email_to_send@gmail.com>", "test", "bonjour XXXX");
}
void loop()
{ }
]
It works very well !! ;)
Who is online
Users browsing this forum: No registered users and 132 guests