I know this is an old topic but just incase if will help someone in the future I figured I would post anyway.
You forgot a few key lines in your Telnet session. Also, everyone is correct you will need add the security if you want to email gmail directly. I build a windows SMTP server inside my LAN so I was able to avoid using any security, but then my SMTP server communicates to Gmail securely. I did not go through all the code just changed the top lines and started adding my code for my LCD.
Here is the updated code. This works and my Arduino send email directly to my SMTP server.
#include <Ethernet.h>
//#include <LiquidCrystal.h>
byte mac[] = { 0x00, 0x23, 0xc9, 0x8e, 0x77, 0xb4 };
byte ip[] = { 1*, 4*, 2*, 2** };
byte gateway[] = { 1*, 4*, 1*, 2 };
byte server[] = { 1*, 4*, 1*, 1* }; // Mailserver
byte subnet[] = { 255, 255, 240, 0 };
int time = 5000;
int wait = 1000;
//LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2);
//int backlight = 13;
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, gateway, subnet);
delay(1000);
//pinMode(backlight, OUTPUT);
//digitalWrite(backlight, HIGH);
//lcd.begin(2,16);
//lcd.clear();
//lcd.setCursor(0,0);
//lcd.print("connectting...");
if (client.connect()) {
//pinMode(backlight, OUTPUT);
//digitalWrite(backlight, HIGH);
//lcd.begin(2,16);
//lcd.clear();
//lcd.setCursor(0,0);
//lcd.print("connected...");
client.println("HELO something.com"); /* say hello*/
delay(wait); /* wait for a response */
client.println("MAIL FROM:me@something.com"); /* identify sender */
delay(wait); /* wait for a response */
client.println("RCPT TO:you@gmail.com"); /* identify recipient */
delay(wait); /* wait for a response */
client.println("DATA");
delay(wait); /* wait for a response */
client.println("Subject:You Have Mail!!"); /* insert subject */
client.println("");
client.println("Sent from Arduino!!!"); /* insert body */
client.println(".");
client.println("QUIT"); /* terminate connection */
delay(wait); /* wait for a response */
client.println();
} else {
//lcd.begin(2,16);
//lcd.clear();
//lcd.setCursor(0,0);
//lcd.print("disconnected...");
}
}
void loop()
{
if (client.available()) {
char c = client.read();
Serial.print(c);
}
if (!client.connected()) {
Serial.println();
Serial.println("disconnecting.");
client.stop();
for(;

;
}
}