1 haharen Jul 09, 2016 06:45
3 haharen Jul 09, 2016 06:55
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'] );
to
global $servertimenow;
$Swift_Message->setDate( $servertimenow );
That's all.
I know it's just a temporary solution, still need our programmer to deal with it.
Best regards.
4 mgsolipa Jul 09, 2016 14:19
@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!
5 haharen Jul 09, 2016 15:56
@mgsolipa
Yes, it's really the best way. I have changed the code and it ran correctly.
Thanks a lot!
6 fplanque Aug 07, 2016 21:38
This will be included in b2evolution 6.7.5.
Detail showing as follows: