lib/mail/Mail.php
public function addTo(
        $to,
        $name = null,
        $substitutions = null,
        $personalizationIndex = null,
        $personalization = null
    ) {
        if ($to instanceof To) {
            $name = $to->getName();
            $substitutions = $to->getSubstitutions();
            $to = $to->getEmailAddress();
        }
        $this->addRecipientEmail(
            "To",
            $to,
            $name,
            $substitutions,
            $personalizationIndex,
            $personalization
        );
    }
public function addTo(
        $to,
        $name = null,
        $substitutions = null,
        $personalizationIndex = null,
        $personalization = null
    ) {
        if ($to instanceof To) {
            $name = $to->getName();
            $substitutions = $to->getSubstitutions();
            $to = $to->getEmailAddress();
        }
        $this->addRecipientEmail(
            "To",
            $to,
            $name,
            $substitutions,
            $personalizationIndex,
            $personalization
        );
    }
public function addTo ( $ to , $ name = null , $ substitutions = null , $ personalizationIndex = null , $ personalization = null ) { if ( $ to instanceof To ) { $ name = $ to -> getName ( ) ; $ substitutions = $ to -> getSubstitutions ( ) ; $ to = $ to -> getEmailAddress ( ) ; } $ this -> addRecipientEmail ( "To" , $ to , $ name , $ substitutions , $ personalizationIndex , $ personalization ) ; }
Adds an email recipient to a Personalization object

@param string|To $to Email address or To object
@param string $name Recipient name
@param array|Substitution[] $substitutions Personalized substitutions
@param int|null $personalizationIndex Index into an array of
existing Personalization
objects
@param Personalization|null $personalization A pre-created
Personalization object
Adds an email recipient to a Personalization object