PHP發送郵件函數庫 XPertMailer
你可以利用XPertMailer來發送MIME類型的郵件如text,HTML,含圖片的HTML頁面,附件等。支持Cc和Bcc功能。

- Can send e-mails with multiple TOs, CCs, BCCs
- Multipart MIME format for mail clients that do not read HTML e-mail
- Multiple ways to send e-mails (local, client, relay, command line on Unix)
- Protection against mail header injection
- Embedded image support for HTML
- Address, attachment and header reset functions
- Support for 8bit, base64, binary, and quoted-printable encoding
示例代碼:
define('DISPLAY_XPM4_ERRORS', true); // display XPM4 errors
require_once '/path-to/MAIL.php'; // path to 'MAIL.php' file from XPM4 package
$m = new MAIL; // initialize MAIL class
$m->From('username@myaddress.net'); // set from address
$m->AddTo('client@destination.net'); // add to address
$m->Subject('Hello World!'); // set subject
$m->Text('Text message.'); // set text message
// connect to MTA server 'smtp.hostname.net' port '25' with authentication: 'username'/'password'
$c = $m->Connect('smtp.hostname.net', 25, 'username', 'password') or die(print_r($m->Result));
// send mail relay using the '$c' resource connection
echo $m->Send($c) ? 'Mail sent !' : 'Error !';
$m->Disconnect(); // disconnect from server
print_r($m->History); // optional, for debugging
本文由用戶 fmms 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!