I need to find out how to read a response from a server in a telnet session? I have the code that seems to work but I am not getting the results I expected and if I had the server feedback it would help me debug the code. I am not quite sure how to do that. Can anyone point me in the correct direction? Script is below.
The commands do work in a regular telnet session on a computer I just need to get it working here. Thanks so much.
bool SendEmails(int task) {
Serial.print(F("OK\r\nConnecting to server..."));
client = cc3000.connectTCP(ip, 2525);
delay(500);
Serial.print("connected");
// sending telnet ELOW
Serial.println("Sending ELOW: ");
client.fastrprintln (F("EHLO"));
// Need a response from server here
delay(500);
//Telnet login authorization command
Serial.println("Sending auth login: ");
client.fastrprintln (F("AUTH LOGIN"));
// Need a response from server here
delay(500);
// Base64 Username
Serial.println("Sending BASE64() login: ");
client.fastrprintln (F("cm9vbRvvb24uY29t")); // replace with base64() hash for STMP2GO
// Need a response from server here
delay(500);
Serial.println("Sending BASE64() Password: ");
client.fastrprintln (F("MjMgQTRsZ3g=")); // replace with base64() hash for STMP2GO delay(500);
// Need a response from server here
delay(500);
// Mail sent from
Serial.println("Mail from: ");
client.fastrprintln (F("mail from: Northport Holding Tank <me@me.com>"));
// Need a response from server here
delay(500);
//Mail being sent to
Serial.println("Mail to: ");
client.fastrprintln (F("rcpt to: Daniel Rahenkamp <you@me.com> "));
// print server response
delay(500);
// Check Ram
Serial.print("freeram1:");
Serial.println(freeRam ());
// Need a response from server here
delay(500);
//Send Email Body
client.println("DATA");
client.fastrprintln (F("To: Recipient Name From: Sender Name Subject: Test message This is a test message to verify SMTP2GO relay using telnet."));
// print server response
delay(500);
// Check Ram
Serial.print("freeram2:");
Serial.println(freeRam ());
// print server response
delay(500);
//end of message
client.fastrprintln (F("."));
// print server response
// Need a response from server here
delay(500);
//quit SMTP server
Serial.println("QUIT: ");
client.fastrprintln (F("QUIT"));
// print server response
delay(500);
// sent = true;
Serial.println("Send Email Done:");
//return sent;
}