Back to Mail class

Method addRecipient

public \Joomla\CMS\Mail\Mail|bool
addRecipient
(mixed $recipient, mixed $name = '')
Add recipients to the email
Parameters
  • mixed $recipient Either a string or array of strings [email address(es)]
  • mixed $name Either a string or array of strings [name(s)]
Returns
  • \Joomla\CMS\Mail\Mail|bool Returns this object for chaining on success or false on failure when exception throwing is disabled.
Since
  • 1.7.0
-
  • \PHPMailer\PHPMailer\Exception if exception throwing is enabled
Class: Mail
Project: Joomla

Method addRecipient - Source code

/**
 * 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  Mail|boolean  Returns this object for chaining on success or false on failure when exception throwing is disabled.
 *
 * @since   1.7.0
 *
 * @throws  phpmailerException  if exception throwing is enabled
 */
public function addRecipient($recipient, $name = '')
{
    return $this->add($recipient, $name, 'addAddress');
}