Pop\Mail\Mail::setHtml PHP Method

setHtml() public method

Set HTML part of the message.
public setHtml ( string $html ) : Mail
$html string
return Mail
    public function setHtml($html)
    {
        $this->message->setHtml($html);
        return $this;
    }

Usage Example

コード例 #1
0
ファイル: mail2.php プロジェクト: nicksagona/PopPHP
    $rcpts = array(array('name' => 'Test Smith', 'email' => '*****@*****.**'), array('name' => 'Someone Else', 'email' => '*****@*****.**'));
    $html = <<<HTMLMSG
<html>
<head>
    <title>
        Test HTML Email
    </title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
    <h1>Hello [{name}]</h1>
    <p>
        I'm just trying out this new Pop Mail Library component.
    </p>
    <p>
        Thanks,<br />
        Bob
    </p>
</body>
</html>

HTMLMSG;
    $mail = new Mail('Hello World!', $rcpts);
    $mail->from('*****@*****.**', 'Bob')->setHeaders(array('X-Mailer' => 'PHP/' . phpversion(), 'X-Priority' => '3'));
    $mail->setText("Hello [{name}],\n\nI'm just trying out this new Pop Mail component.\n\nThanks,\nBob\n\n");
    $mail->setHtml($html);
    $mail->send();
    echo 'Mail Sent!';
} catch (\Exception $e) {
    echo $e->getMessage();
}
All Usage Examples Of Pop\Mail\Mail::setHtml