horst-n / WireMailSmtp

ProcessWire: Extension to the new WireMail baseclass (since PW 2.4.1)
15 stars 9 forks source link

Date issue WireMailSmtpAdaptor.php #5

Closed selsermedia closed 8 years ago

selsermedia commented 8 years ago

There is a string formatting error on date string set on line 350 in WireMailSmtpAdapter.php

$this->emailMessage->SetHeader("Date", gmdate("D, j M Y H:i:s \G\M\T P"));

Systems strictly observing RFC2822, will not accept the addition of the (Difference to Greenwich time (GMT) with colon between hours and minutes )added to the end date string created.

This causes issues with systems like Amazon AWS SES, Rackspace Mailgun, among others.

Line 350 should be changed to.

$this->emailMessage->SetHeader("Date", gmdate("D, j M Y H:i:s \G\M\T"));

https://www.ietf.org/rfc/rfc2822.txt

Credit goes to Rackspace tech support for isolating this.

horst-n commented 8 years ago

fixed it! Many thanks for contributing / sharing!