// Jayconsystems.com // Based on the excellent guide at: // www.scribd.com/doc/88533821/Arduino-Et-Internet-A-Quick-Start-Guide #include #include #include "Smtp_Service.h" const unsigned int SMTP_PORT = 587; byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; byte my_ip[] = {192, 168, 0, 120}; byte gateway[] = {192, 168, 0, 1}; byte smtp_server[] = { 200, 234, 210, 12}; SmtpService smtp_service(smtp_server, SMTP_PORT); char incString[250]; String login = "bGVhbmRyby5oYXNpbW90b0BkaWNvcmVs=="; String password = "NTgyMTkxb="; Email email; void setup() { Ethernet.begin(mac, my_ip, gateway); Serial.begin(9600); Serial.setTimeout(500000); delay(1000); email.setLogin(login); email.setPassword(password); email.setFrom("leandro.hasimoto@dicorel.com"); email.setTo("leandro.hasimoto@dicorel.com"); email.setCc(""); email.setSubject("ALARME ARDUINO"); email.setBody("A TEMPERATURA ESTÁ ACIMA DE 30ºC"); } void loop() { if (Serial.available() > 0) { byte inByte = Serial.read(); if (inByte == 'S') { smtp_service.send_email(email); } delay(1000); } }