That's a BUG.
I just facing the same problem, no matter how I pass the arguments, it just can't specify the name.
And in the Joomla! source code /libraries/joomla/mail/mail.php, from line 167, the doc comment says:
/**
* Add recipients to the email
*
* @param mixed $recipient Either a string or array of strings [email address(es)]
* @param mixed $name Either a string or array of strings [name(s)]
*
* @return JMail Returns this object for chaining.
*
* @since 11.1
*/
Fine, but the variable $name NEVER be used in the function:
public function addRecipient($recipient, $name = '')
{
// If the recipient is an array, add each recipient... otherwise just add the one
if (is_array($recipient))
{
foreach ($recipient as $to)
{
$to = JMailHelper::cleanLine($to);
$this->AddAddress($to);
}
}
else
{
$recipient = JMailHelper::cleanLine($recipient);
$this->AddAddress($recipient);
}
return $this;
}