Fixed \XF\Mail\Mailer::send: $fromEmail contains To addresses, not From addresses

PaulB

Well-known member
Affected version
2.2.9
Simple copy-paste error:
PHP:
   $to = $message->getTo();
   $toEmails = $to ? implode(', ', array_keys($to)) : '[unknown]';

   $from = $message->getFrom();
   $fromEmail = $from ? implode(', ', array_keys($to)) : '[unknown]' ;
The error is on the last line: instead of array_keys($from), it's using array_keys($to). This results in confusing error messages such as the following:
Code:
ErrorException: Email to user-email@domain.example from user-email@domain.example failed: [E_WARNING] fwrite(): SSL: Broken pipe
 
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.2.12).

Change log:
Fix $fromEmail variable not being set correctly when sending emails
There may be a delay before changes are rolled out to the XenForo Community.
 
Back
Top Bottom