PHP发送邮件函数库 XPertMailer
fmms
13年前
<p>你可以利用XPertMailer来发送MIME类型的邮件如text,HTML,含图片的HTML页面,附件等。支持Cc和Bcc功能。<br /> <img title="logo.jpg" border="0" alt="logo.jpg" src="https://simg.open-open.com/show/2fcef625842995214d08793793a577ca.jpg" width="255" height="82" /><br /> </p> <ul> <li>Can send e-mails with multiple TOs, CCs, BCCs</li> <li>Multipart MIME format for mail clients that do not read HTML e-mail</li> <li>Multiple ways to send e-mails (local, client, relay, command line on Unix)</li> <li>Protection against mail header injection</li> <li>Embedded image support for HTML</li> <li>Address, attachment and header reset functions</li> <li>Support for 8bit, base64, binary, and quoted-printable encoding</li> </ul> <p>示例代码:</p> <pre class="brush:php; toolbar: true; auto-links: false;">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</pre> <p><strong>项目主页:</strong><a href="http://www.open-open.com/lib/view/home/1327578655311" target="_blank">http://www.open-open.com/lib/view/home/1327578655311</a></p> <p></p>