public function setTo($email, $name = '')
    {
        if (empty($email)) {
            throw new MailerException('email is required for setTo!');
        }

        if (empty($name)) {
            $name = substr($email, 0, strrpos($email, '@'));
        }

        if (is_null($this->to)) {
            $this->to = [$email, $name];
        } else {
            throw new MailerException('A master recipient has already been set!');
        }

        return $this;
    }
public function setTo($email, $name = '')
    {
        if (empty($email)) {
            throw new MailerException('email is required for setTo!');
        }

        if (empty($name)) {
            $name = substr($email, 0, strrpos($email, '@'));
        }

        if (is_null($this->to)) {
            $this->to = [$email, $name];
        } else {
            throw new MailerException('A master recipient has already been set!');
        }

        return $this;
    }
public function setTo ( $ email , $ name = '' ) { if ( empty ( $ email ) ) { throw new MailerException ( 'email is required for setTo!' ) ; } if ( empty ( $ name ) ) { $ name = substr ( $ email , 0 , strrpos ( $ email , '@' ) ) ; } if ( is_null ( $ this -> to ) ) { $ this -> to = [ $ email , $ name ] ; } else { throw new MailerException ( 'A master recipient has already been set!' ) ; } return $ this ; }
Sets the Recipient of the email.

@param string $email
@param string $name

@return \Scara\Mail\Mailer
Sets the Recipient of the email .