-1
我使用xpertmailer在MX查找後直接發送電子郵件到遠程SMTP服務器。這工作得非常好,適用於運行PHP4的舊式封閉源NAS驅動器和當前的PHP5盒子。PHP Direct SMTP發送+附件
<?php
define('DISPLAY_XPM4_ERRORS', true); // display XPM4 errors
require_once '/path-to/SMTP.php'; // path to 'SMTP.php' file from XPM4 package
$f = '[email protected]'; // from mail address
$t = '[email protected]'; // to mail address
// standard mail message RFC2822
$m = 'From: '.$f."\r\n".
'To: '.$t."\r\n".
'Subject: test'."\r\n".
'Content-Type: text/plain'."\r\n\r\n".
'Text message.';
$h = explode('@', $t); // get client hostname
$c = SMTP::MXconnect($h[1]); // connect to SMTP server (direct) from MX hosts list
$s = SMTP::Send($c, array($t), $m, $f); // send mail
// print result
if ($s) echo 'Sent !';
else print_r($_RESULT);
SMTP::Disconnect($c); // disconnect
?>
我現在試圖將附件添加到它,但我不知道怎麼去被列入附件併發送。
任何任何想法,我可以做到這一點?
感謝
您檢查了http://xpertmailer.sourceforge.net/documentation/? 「Attach」是左側列表中的第5個項目,看起來相當簡單。 –