I am currently sending emails from my Arduino Mega using Smtp2Go. Unfortunately, I have to hard code the IP address as follows:
byte server[] = { 207,58,147,66 }; // Nslookup smtpcorp.com
EthernetClient client;
void sendEmail(char subject[], char message1[], char message2[], float temp) {
if (client.connect(server,2525)) {
Serial.println("connected");
}
Is there any way I can use smtpcorp.com instead of 207.58.147.66? IP addresses can change (and often do). If smtpcorp.com changes the IP address, my program will fail. So, I'd like to prevent that problem by using DNS for name resolution. Is this possible?