-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathespEmail.h
66 lines (45 loc) · 1.61 KB
/
espEmail.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// espEmail.h
#ifndef _ESPEMAIL_h
#define _ESPEMAIL_h
#if defined(ARDUINO) && ARDUINO >= 100
#include "arduino.h"
#else
#include "WProgram.h"
#endif
/*
esp8266 Email & Text Messge
by Ben Lipsey www.varind.com 2016. This code is public domain, enjoy!
github: http://github.com/varind/esp8266-SMTP
Convert your user/pass to base 64:
https://www.base64decode.org
Based on sketch by Erni
http://www.esp8266.com/viewtopic.php?f=32&t=6139#p32186
original sketch:
http://playground.arduino.cc/Code/Email?action=sourceblock&num=2
Email client sketch for IDE v1.0.5 and w5100/w5200
Posted 7 May 2015 by SurferTim
*/
#include <ESP8266WiFi.h>
class espSendMailClass {
protected:
byte eRcv(WiFiClient client);
boolean debugSerial = true;
public:
espSendMailClass(); //constructor
// Email Settings
String server = "mail.yourserver.com"; // mail.yourMailServer.com
int port = 25; // your outgoing port; my server uses 25
String user = "user"; // base64, ASCII encoded user
String pass = "pass"; // base64, ASCII encoded password
String from = "[email protected]"; // [email protected]
String to = "[email protected]"; // [email protected]
String myName = "Your Name"; // Your name to display
String subject = "esp8266 Test"; // email subject
String message = " "; //"This message is from your esp8266.\nIt works!";
//-------------------------------------
String Status = "";
String ReturnMsg = "";
byte sendEmail();
};
//-See more at : http ://www.esp8266.com/viewtopic.php?f=32&t=6139&start=12#sthash.Zqs86CHI.dpuf
#endif