SMTP fix data header

MyDoorOpener custom/homebrew "Arduino" backend enhancements sharing and discussions.

SMTP fix data header

Postby ToddG » Fri Aug 30, 2013 10:23 am

In order to get the SMTP and SMS working I had to update the email header to include the TO and FROM elements. This is not the same as RCTP TO and MAIL FROM. This was required by TimeWarner RoadRunner (and potentially other providers) to make it work. The following bolded code was added to the notifyViaEmail function (which is around line 300).
...
smtpClient.println(F("HELO relay.mydooropener.com"));

smtpClient.print(F("MAIL FROM:"));
smtpClient.println(F("noreply@mydooropener.com"));

smtpClient.print(F("RCPT TO:"));
smtpClient.println(to);

smtpClient.println(F("DATA"));

smtpClient.print(F("SUBJECT: "));
smtpClient.println(subject);

// Added the following to email header as required by some ISP such as RoadRunner.
// 8-30-2013 TSG
smtpClient.print(F("TO: "));
smtpClient.println(to);
smtpClient.print(F("FROM: "));
smtpClient.println(F("noreply@mydooropener.com"));
// End TSG Change

smtpClient.println();

smtpClient.print(body);
smtpClient.print(F(" "));
smtpClient.println(F("mydooropener://status"));
...
ToddG
 
Posts: 6
Joined: Sun Aug 25, 2013 4:34 pm

Re: SMTP fix data header

Postby support » Fri Aug 30, 2013 8:15 pm

Thanks for sharing Todd. Appreciated!
support
Site Admin
 
Posts: 384
Joined: Thu Aug 22, 2013 7:30 pm


Return to Arduino Backend Enhancements



cron