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

There is a bug in this version
P

PaulB

Guest
Simple copy-paste error:
PHP:

Code:
   $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()...

Read more

Continue reading...