Sending email thru smtp2go

Hi, i refer to the https://playground.arduino.cc/Code/Email to send email using arduino uno with w5100 ethernet shield.
After i uploaded, i type ‘e’ at the serial monitor and managed to establish the connection and have the hello and ipaddress printed. However there is timeout and the email failed. The login and password with my smtp2go account were encoded. I did not receive any email. Please advise.

Below are my codes.
#include <SPI.h> // needed for Arduino versions later than 0018
#include <Ethernet.h>

//byte mac = { 0x90, 0xA2, 0xDA, 0x02, 0x00, 0x7D };
//byte mac = { 0x98, 0xDE, 0xD0, 0xB4, 0x06, 0x90 };
byte mac = { 0xFE, 0xDA, 0xA1, 0xD8, 0xAA, 0xA1 };
IPAddress ip( 192, 168, 0, 222 );
IPAddress gateway( 192, 168, 0, 1 );
IPAddress subnet( 255, 255, 255, 0 );
/byte ip[] = { 192, 168, 0, 222 }; // change to a valid address for your network
byte gateway[] ={192, 168, 0, 1 };
byte subnet( 255, 255, 255, 0 );
/
char server=“mail.smtp2go.com”;
//char server=“smtpcorp.com”;

int port = 8025;
EthernetClient client;

/*
Pushbutton sketch
a switch connected to pin 2 lights the LED on pin 13
*/
const int ledPin = 13; // choose the pin for the LED
const int inputPin = 2; // choose the input pin (for a pushbutton)

void setup() {
Serial.begin(9600);
delay(1000);
pinMode(4,OUTPUT);
digitalWrite(4,HIGH);
Ethernet.begin(mac, ip, gateway, gateway, subnet);
delay(2000);
Serial.println(F(“Ready. Press ‘e’ to send.”));
pinMode(ledPin, OUTPUT); // declare LED as output
pinMode(inputPin, INPUT); // declare pushbutton as input
}

void loop()
{

byte inChar;
inChar = Serial.read();
if(inChar == ‘e’)
{
if(sendEmail()) Serial.println(F(“Email sent”));
else Serial.println(F(“Email failed”));
}
}

byte sendEmail()
{
byte thisByte = 0;
byte respCode;

if(client.connect(server,port) == 1) {
Serial.println(F(“connected”));
} else
{
Serial.println(F(“connection failed”));
return 0;
}
if(!eRcv())
return 0;
Serial.println(F(“Sending hello”));
// replace 1.2.3.4 with your Arduino’s ip
client.println(“EHLO 192.168.0.222”);
if(!eRcv())
return 0;
Serial.println(F(“Sending auth login”));
client.println(“auth login”);
if(!eRcv())
return 0;
Serial.println(F(“Sending User”));
client.write(“c2FuZHlwcm9qZWN0MjFAZ21haWwuY29t”);
if(!eRcv()) return 0;

Serial.println(F(“Sending Password”));
client.write(“VG5YSHZkNGhickMw”);
if(!eRcv()) return 0;
Serial.println(F(“Sending From”));
client.println(“MAIL FROM:sandyproject21@gmail.com”);
if(!eRcv()) return 0;

Serial.println(F(“Sending To”));
client.println(“RCPT TO:sandyproject21@gmail.com”);
if(!eRcv()) return 0;

Serial.println(F(“Sending DATA”));
client.println(“DATA”);
if(!eRcv()) return 0;

Serial.println(F(“Sending email”));

// change to recipient address
client.println(“To: sandyproject21@gmail.com”);

// change to your address
client.println(“From: sandyproject21@gmail.com”);

client.println(“Subject: Arduino email test\r\n”);

client.println(“This is from my Arduino!”);

client.println(".");

if(!eRcv())
return 0;

Serial.println(F(“Sending QUIT”));
client.println(“QUIT”);
if(!eRcv()) return 0;

client.stop();

Serial.println(F(“disconnected”));

return 1;
}

byte eRcv()
{
byte respCode;
byte thisByte;
int loopCount = 0;
while(!client.available()) {
delay(1);
loopCount++;

// if nothing received for 5 seconds, timeout
if(loopCount > 5000) {
client.stop();
Serial.println(F("\r\nTimeout"));
return 0;
}
}
respCode = client.peek();

while(client.available())
{
thisByte = client.read();
Serial.write(thisByte);
}

if(respCode >= ‘4’)
{
efail();
return 0;
}return 1;
}

void efail()
{
byte thisByte = 0;
int loopCount = 0;

client.println(F(“QUIT”));

while(!client.available()) {
delay(1);
loopCount++;

// if nothing received for 10 seconds, timeout
if(loopCount > 10000) {
client.stop();
Serial.println(F("\r\nTimeout"));
return;
}
}

while(client.available())
{
thisByte = client.read();
Serial.write(thisByte);
}

client.stop();

Serial.println(F(“disconnected”));
}

I tried to follow your code. Your style sucks. NOTHING follows a } on the same line, except a ; in rare cases.

Indenting is a GOOD THING. Try it. Tools + Auto Format makes it easy.

Showing some serial output would be useful, too. So would code tags.