PHPMailer\PHPMailer

SMTP::mailpublicWP 1.0

Send an SMTP MAIL command. Starts a mail transaction from the email address specified in $from. Returns true if successful or false otherwise. If True the mail transaction is started and then one or more recipient commands may be called followed by a data command. Implements RFC 821: MAIL <SP> FROM:<reverse-path> <CRLF> and two extensions, namely XVERP and SMTPUTF8.

The server's EHLO response is not checked. If use of either extensions is enabled even though the server does not support that, mail submission will fail.

XVERP is documented at https://www.postfix.org/VERP_README.html and SMTPUTF8 is specified in RFC 6531.

Method of the class: SMTP{}

No Hooks.

Returns

true|false.

Usage

$SMTP = new SMTP();
$SMTP->mail( $from );
$from(string) (required)
Source address of this message.

SMTP::mail() code WP 7.0

public function mail($from)
{
    $useVerp = ($this->do_verp ? ' XVERP' : '');
    $useSmtputf8 = ($this->do_smtputf8 ? ' SMTPUTF8' : '');

    return $this->sendCommand(
        'MAIL FROM',
        'MAIL FROM:<' . $from . '>' . $useSmtputf8 . $useVerp,
        250
    );
}