-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSmtpClient.h
43 lines (37 loc) · 981 Bytes
/
SmtpClient.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
#ifndef SMTP_CLIENT_H
#define SMTP_CLIENT_H
#include "Arduino.h"
#include "Client.h"
#include "Mail.h"
class SmtpClient {
public:
SmtpClient(Client *client, char *server);
SmtpClient(Client *client, char *server, uint16_t port);
SmtpClient(Client *client, IPAddress serverIP);
SmtpClient(Client *client, IPAddress serverIP, uint16_t port);
SmtpClient(Client* client, char *server, bool use_ssl);
int send(Mail *mail);
int GetErrorLine();
char *GetErrorText();
private:
char *_server;
IPAddress _serverIP;
uint16_t _port;
Client *_client;
int _send(Mail *mail);
int connect();
int helo();
int mailFrom(char *from);
int rcptTo(Mail *mail);
int data();
void headers(Mail *mail);
void header(char *header, char* value);
void recipientHeader(char *header, recipient_t type, Mail *mail);
void body(char *body);
int finishBody();
int readStatus();
int readLine(char *line, int maxLen);
char *errortext;
int errorline;
};
#endif