Arduino Uno Quick Start Manual page 206

Hide thumbs Also See for Arduino Uno:
Table of Contents

Advertisement

Ethernet/Email/smtp_service.h
#ifndef __SMTP_SERVICE__H_
Line 1
#define __SMTP_SERVICE__H_
-
-
#include "email.h"
-
5
class
SmtpService {
-
boolean
_use_auth;
-
IPAddress
_smtp_server;
-
unsigned int
_port;
-
String
_username;
10
String
_password;
-
-
void
read_response(EthernetClient& client) {
-
delay(4000);
-
while
(client.available()) {
15
const char
-
Serial.print(c);
-
}
-
}
-
20
void
send_line(EthernetClient& client, String line) {
-
const unsigned int
-
char
buffer[MAX_LINE];
-
line.toCharArray(buffer, MAX_LINE);
-
Serial.println(buffer);
25
client.println(buffer);
-
read_response(client);
-
}
-
-
public:
30
-
SmtpService(
-
const
IPAddress&
-
const unsigned int
-
35
-
-
SmtpService(
-
const
IPAddress&
-
const unsigned int
40
const
String&
-
const
String&
-
-
-
45
-
-
void send_email(const
-
EthernetClient client;
-
Chapter 11. Creating a Burglar Alarm with Email Notification
c = client.read();
MAX_LINE = 256;
smtp_server,
port) : _use_auth(false),
_smtp_server(smtp_server),
_port(port) { }
smtp_server,
port,
username,
password) : _use_auth(true),
_smtp_server(smtp_server),
_port(port),
_username(username),
_password(password) { }
Email& email) {
www.it-ebooks.info
190
report erratum
discuss

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Arduino Uno and is the answer not in the manual?

Table of Contents