EasyManuals Logo

Arduino uno User Manual

Arduino uno
311 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #207 background imageLoading...
Page #207 background image
Serial.print("Connecting...");
50
-
if (client.connect(_smtp_server, _port) <= 0) {
-
Serial.println("connection failed.");
-
} else {
-
Serial.println("connected.");
55
read_response(client);
-
if (!_use_auth) {
-
Serial.println("Using no authentication.");
-
send_line(client, "helo");
-
}
60
else {
-
Serial.println("Using authentication.");
-
send_line(client, "ehlo");
-
send_line(client, "auth login");
-
send_line(client, _username);
65
send_line(client, _password);
-
}
-
send_line(
-
client,
-
"mail from: <" + email.getFrom() + ">"
70
);
-
send_line(
-
client,
-
"rcpt to: <" + email.getTo() + ">"
-
);
75
send_line(client, "data");
-
send_line(client, "from: " + email.getFrom());
-
send_line(client, "to: " + email.getTo());
-
send_line(client, "subject: " + email.getSubject());
-
send_line(client, "");
80
send_line(client, email.getBody());
-
send_line(client, ".");
-
send_line(client, "quit");
-
client.println("Disconnecting.");
-
client.stop();
85
}
-
}
-
};
-
-
#endif
90
Admittedly, this is a lot of code, but well walk through it step by step. First,
the
SmtpService
class encapsulates the SMTP servers IP address and its port.
These attributes are required in any case. In addition, we store a username
and a password in case someones going to use an authenticated connection.
To communicate with an SMTP server, we have to read its responses, and we
do that using the private
read_response
method starting on line 13. It waits for
report erratum discuss
Emailing Directly from an Arduino 191
www.it-ebooks.info

Table of Contents

Other manuals for Arduino uno

Questions and Answers:

Question and Answer IconNeed help?

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

Arduino uno Specifications

General IconGeneral
Form factorArduino
CertificationRoHS, FC, CE
Processor model-
Processor frequency- MHz
Microcontroller modelATmega328
Microcontroller frequency16 MHz
DC input voltage7-12 V
Operating voltage5 V
DC current per I/O pin40 mA
Flash memory0.032 MB
Maximum internal memory- GB
SRAM (Static Random Access Memory)2 KB
EEPROM (Electrically Erasable Programmable Read-Only Memory)1 KB
Wi-FiNo
Number of analog I/O pins6
Number of digital I/O pins14
Weight and Dimensions IconWeight and Dimensions
Board dimensions53.4 x 68.6 mm

Related product manuals