Back to Mail class

Method addCc

public \Joomla\CMS\Mail\Mail|bool
addCc
(mixed $cc, mixed $name = '')
Add carbon copy recipients to the email
Parameters
  • mixed $cc 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 boolean false on failure when exception throwing is enabled.
Since
  • 1.7.0
-
  • \PHPMailer\PHPMailer\Exception if exception throwing is enabled
Class: Mail
Project: Joomla

Method addCc - Source code

/**
 * Add carbon copy recipients to the email
 *
 * @param   mixed  $cc    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 boolean false on failure when exception throwing is enabled.
 *
 * @since   1.7.0
 *
 * @throws  phpmailerException  if exception throwing is enabled
 */
public function addCc($cc, $name = '')
{
    // If the carbon copy recipient is an array, add each recipient... otherwise just add the one
    if (isset($cc)) {
        return $this->add($cc, $name, 'addCC');
    }
    return $this;
}