lib/mail/Mail.php
public function setFrom($email, $name = null)
    {
        if ($email instanceof From) {
            $this->from = $email;
        } else {

            if (
                is_string($email) && filter_var($email, FILTER_VALIDATE_EMAIL)
            ) {
                $this->from = new From($email, $name);
            } else {
                throw new TypeException(
                    '$email must be valid and of type string.'
                );
            }

        }
        return;
    }
public function setFrom($email, $name = null)
    {
        if ($email instanceof From) {
            $this->from = $email;
        } else {

            if (
                is_string($email) && filter_var($email, FILTER_VALIDATE_EMAIL)
            ) {
                $this->from = new From($email, $name);
            } else {
                throw new TypeException(
                    '$email must be valid and of type string.'
                );
            }

        }
        return;
    }
public function setFrom ( $ email , $ name = null ) { if ( $ email instanceof From ) { $ this -> from = $ email ; } else { if ( is_string ( $ email ) && filter_var ( $ email , FILTER_VALIDATE_EMAIL ) ) { $ this -> from = new From ( $ email , $ name ) ; } else { throw new TypeException ( '$email must be valid and of type string.' ) ; } } return ; }
Add the sender email address to a Mail object

@param string|From $email Email address or From object
@param string|null $name  Sender name

@throws TypeException
Add the sender email address to a Mail object