Ok, I think I am starting to see how this is going to work. I have put together some code that would ideally send an email, right now it connects and tells me 220 then disconnects im not sure how to get the responses to show up on my serial monitor. I essentially just modified the Ethernet example for connecting to google and changed the IP address and port. I have left it as Gmail but I will change it to my ISP's address and port (if different). Also I have used "*" to mask my own IP address and MAC address (which I tested and they work).
here is my code:
[glow]#include <Ethernet.h>
byte mac[] = { 0x*, 0x*, 0x*, 0x*, 0x*, 0x* };
byte ip[] = { *, *, 1, * };
byte server[] = { 64, 233, 167, 111 }; // Gmail
int time = 5000;
int wait = 1000;
Client client(server, 25);
void setup()
{
delay(time); /* allow the router to identify the Arduino before the Arduino connects to the internet */
Ethernet.begin(mac, ip);
Serial.begin(9600);
delay(1000);
Serial.println("connecting...");
if (client.connect()) {
Serial.println("connected");
client.println("HELO
thisisme@gmail.com"); /* say hello*/
delay(wait); /* wait for a response */
client.println("MAIL From:<
thisisme@gmail.com>"); /* identify sender */
delay(wait); /* wait for a response */
client.println("RCPT To:
thisisyou@gmail.com>"); /* identify recipient */
delay(wait); /* wait for a response */
client.println("DATA");
delay(wait); /* wait for a response */
client.println("To:
thisisyou@gmail.com"); /* identify recipient */
client.println("Subject: You Have Mail!!"); /* insert subject */
client.println("Please let me know it worked!!!"); /* insert body */
client.println("QUIT"); /* terminate connection */
delay(wait); /* wait for a response */
client.println();
} else {
Serial.println("connection failed");
}
}
void loop()
{
if (client.available()) {
char c = client.read();
Serial.print(c);
}
if (!client.connected()) {
Serial.println();
Serial.println("disconnecting.");
client.stop();
for(;

;
}
}
[/glow]
now at this point I still need the responses from the isp to be displayed on the screen so that I can tell if there is a problem and where.
right now I see:
connecting...
connected
220
disconnectingFurthermore, I do not receive an email or at least it hasn't arrived yet, but the connected line does sound promising. Also is client.println() the right function to use to communicate with the server?
-Enrico