2 haharen Jul 09, 2016 06:48



I have found the email sending code place , it seems that the header date is incorrect, and change little code would be OK.
inc\tools\model\_email.funcs.php, in function evo_mail_smtp, change from
$Swift_Message->setDate( $headers['Date'] );global $servertimenow;
$Swift_Message->setDate( $servertimenow );I know it's just a temporary solution, still need our programmer to deal with it.
Best regards.

@haharen thanks for reporting both, issue and solution ;)
That's right, $Swift_Message->;setDate() expects for a UNIX timestamp, instead of a string.
Your solution works and is perfectly correct, but IMHO, I think that evo_mail_smtp is not the place to add b2evolution specific variables as $servertimenow, due to this function is a kind of abstraction layer to access smtp services, so it should respect whatever it's receiving on its $headers parameter.
Maybe we should just try to parse down the value received on $headers['Date'] to an integer value, and let Swift to process it.
Something like this, I guess:
$headers['Date'] = ( is_string($headers['Date']) ) ? strtotime($headers['Date']) : $headers['Date'];
$Swift_Message->setDate( $headers['Date'] );
Regards!

@mgsolipa
Yes, it's really the best way. I have changed the code and it ran correctly.
Thanks a lot!

This will be included in b2evolution 6.7.5.
Detail showing as follows: