void setup() { // Open serial communications and wait for port to open: Serial.begin(115200); } void loop(){ delay(5000); Serial.print("AT+WD\r\n"); //Disconnect from WiFi if currently connected delay(2000); Serial.print("AT+WAUTH=2\r\n"); // set WEP authentication delay(2000); Serial.print("AT+WWPA=password\r\n"); // set Passphrase delay(2000); Serial.print("AT+WA=Chaz's iPhone\r\n"); // The name of your SSID. This will also force it to connect delay(20000); // long pause to wait for connection to Wireless Access Point Serial.print("AT+NCTCP=1.1.1.1,1234\r\n"); // IPAddress, Port. delay(20000); // probably don't need such a long pause here Serial.print("\x1B" "S"); //Send Escape Character and Capital S to initiate 'CID' connection to address above (notice no Carriage Return, Line Feed) delay(2000); Serial.print("0\r\n"); //'CID' number. Should be delay(2000); Serial.print("HELO\r\n"); delay(2000); Serial.print("MAIL FROM:chazwilliams16@augustana.edu\r\n"); // obviously change these to a valid email address delay(2000); Serial.print("RCPT TO:chazwilliams16@augustana.edu\r\n"); // obviously change these to a valid email address delay(2000); Serial.print("data\r\n"); delay(2000); Serial.print("\x1B" "E\r\n"); // You have to Escape out of the sequence and back in again in order for the SMTP server to accept data delay(2000); Serial.print("\x1B" "S"); // Escape Back in (notice no Carriage Return, Line Feed) delay(2000); Serial.print("0\r\n"); // Escape Back in delay(2000); Serial.print("Ratatouille has been captured\r\n"); delay(2000); Serial.print("a bit more\r\n"); delay(2000); Serial.print("\r\n.\r\n"); delay(2000); Serial.print("QUIT\r\n"); delay(2000); Serial.print("\x1B" "E\r\n"); //Escape Out delay(10000); Serial.print("AT+WD\r\n"); //Disconnect from WiFi to conserve power delay(20000); }