所以我已阅读并完成了所有解决方案 PHPMAILER Not sending and not giving error,但我的邮件仍未通过我的SMTP发送。我正在使用hMailServer 5.4-B1950,从'localhost'发送邮件,这是我的代码:
require_once('class.phpmailer.php');
$mail = new PHPMailer();
if ($ways=="cashchequesc"){
$_SESSION['youdont'] = "0";
$mail->IsSMTP();
$mail->Host = "localhost";
//$mail->SMTPAuth = true; // out in-case of future use.
$mail->Port = 25;
//$mail->Username = "deli-pie@gmail.com"; // out cause localhost doesn't seems to need one
//$mail->Password = "ilovepie1984";
$mail->From = ("pie-delivery@pd.com");
$mail->FromName = ("PD-licious Pie");
$mail->AddAddress("piepie314159@gmail.com","PieUser1");
$mail->Subject = $myusername . "'s Purchases of ". $_SESSION['amount'] ." of XXXX.";
$mail->Body = $myusername ." has purchased X number of item for total amount of S$" . $_SESSION["payamount"] . " via CHEQUE/Cash on Collection.";
$mail->WordWrap = 70;