PHP发送邮件函数库 XPertMailer

分享到:

你可以利用XPertMailer来发送MIME类型的邮件如text,HTML,含图片的HTML页面,附件等。支持Cc和Bcc功能。
logo.jpg

  • 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

项目主页:http://www.open-open.com/lib/view/home/1327578655311

昵    称:
验证码:

相关文档: