你可以利用XPertMailer来发送MIME类型的邮件如text,HTML,含图片的HTML页面,附件等。支持Cc和Bcc功能。
示例代码:
<?php
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
?>