SMTP2Go Question

Does anyone know if the Free account of SMTP2GO has a wait period between connections? I am using some standard code I found to send myself a text via email. It works some times then connection fails then if I wait say 5 mins it works again. At first when I was sending and receiving to my email account I was able to connect and send back to back. I have searched online but haven’t been able to find any answers. Does anyone have experience with this service that might know whats going on. Below is my code with pertinent details removed.

#include <SPI.h>
#include <Ethernet.h>

// this must be unique
byte mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0x59, 0x67 };
// change network settings to yours
IPAddress ip(192, 168, 11, 12);
IPAddress gateway(192, 168, 11, 1);
IPAddress subnet(255, 255, 255, 0);

char server[] = "smtp2go.com";
int port = 2525;

EthernetClient client;

void setup()
{
	Serial.begin(115200);
	pinMode(4, OUTPUT);
	digitalWrite(4, HIGH);
	Ethernet.begin(mac, ip);//, ip, gateway, gateway, subnet);
	Serial.println("Setting Up Ethernet.");
	delay(30000);
	Serial.println(Ethernet.localIP());	
}

void loop()
{

	if (sendEmail()) Serial.println(F("Email sent"));
	else Serial.println(F("Email failed"));
	while (1)
	{
		//Endless Loop.
	}
}

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.11.12");
	if (!eRcv()) return 0;

	Serial.println(F("Sending auth login"));
	client.println("auth login");
	if (!eRcv()) return 0;

	Serial.println(F("Sending User"));
	// Change to your base64 encoded user
	client.println("########");

	if (!eRcv()) return 0;

	Serial.println(F("Sending Password"));
	// change to your base64 encoded password
	client.println("########");


	if (!eRcv()) return 0;

	// change to your email address (sender)
	Serial.println(F("Sending From"));
	client.println("MAIL From: <email@blaa.com>");
	if (!eRcv()) return 0;

	// change to recipient address
	Serial.println(F("Sending To"));
	client.println("RCPT To: <1111111111@vtext.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: You <1111111111@vtext.com>");

	// change to your address
	client.println("From: Me <email@blaa.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 10 seconds, timeout
		if (loopCount > 10000) {
			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"));
}

Wouldn't it make more sense to ask the SMTP2Go people?

Issue is unrelated. I have experimented with it further and found that if I plug in the ip address it works every time so I'm assuming that for some reason the domain name is not resolving every time. I'm ok with this work around at the moment so I am moving on with the project.

Thanks,