本文にテキストを使って記述する代わりにHTML文を記述することができます。Mail_Mimeクラスで用意されている「setHTMLBody」メソッドを使います。
<?php include 'Mail.php'; include 'Mail/mime.php' ; $text = 'Text version of email'; $html = '<html><body>HTML version of email</body></html>';
Using PEAR::Mail_Mime, it's easy to add HTML to emails, and even to embed images within the document. This class will automatically determine whether or not you ...
<?php // ライブラリを読み込む。 include 'Mail.php'; include 'Mail/mime.php'; $host = '{SMTPサーバー}'; $port = '586'; $username = '{ユーザーID}'; ...
Mail_Mime provides classes to create MIME messages. ... It allows people to create e-mail messages consisting of: * Text Parts * HTML Parts * Inline HTML Images
<?php /** * The Mail_Mime class is used to create MIME E-mail messages * * The Mail_Mime class provides an OO interface to create MIME * enabled email ...
PEAR Mail_Mimeを使うとHTMLメールも送ることができます。リスト1を見てください。18〜21行目でHTMLのIMGタグで使用する画像ファイルを3種類指定しておきます。
HTMLメールを使う場合にHTMLメールの中で画像を使用する場合は使用する画像ファイルをMail_Mimeクラスで用意されている「addHTMLImage」メソッドを使って指定します。
Mail_Mime - 例 – MIME メールの生成と送信. Example. <?php include('Mail.php'); include('Mail/mime.php'); $text = 'Text version of email'; $html = '<html> ... mail ...
2016/8/3 -You have to set the ContentType on your $mime object $mime = new Mail_mime(); $mime->setHTMLBody($html); $mime->setTXTBody($text); ...