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


Well-known member
Affected version
Simple copy-paste error:
   $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:
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.
Top Bottom