duanjiuhong5843 2015-08-02 01:15
浏览 40

PHPMailer和Mail()都失败了吗? 来自地址失败

require_once("libphp-phpmailer/class.phpmailer.php");

$mail = new PHPMailer();

$mail->IsSMTP();
$mail->Host = "smtp.comcast.net";
//$mail->Host = "localhost";

//$mail->SMTPAuth = true;
$mail->WordWrap = 60;

//$mail->SetFrom("jharvard@cs50.net");
$mail->SetFrom("testmail@example.com");

$mail->AddAddress("kyzcreig@gmail.com");

$mail->Subject = "BUY! Receipt";
$mail->Body = 
    "You just bought {$_POST["symbol"]}: 

";

if ($mail->Send() == false) {
    die($mail->ErrInfo);
}

I get this error when I run the above code:

enter image description here

Not sure what it means. I'm fairly new to PHP too so maybe I'm missing something?

If I try to use the generic mail() function that also fails. Although it doesn't give any error message.

  • 写回答

1条回答 默认 最新

  • doushao1948 2015-08-03 08:29
    关注

    I had no default SMTP settings so naturally the default mail() wasn't working. I configured things to use first my gmail account/smtp server and then later (so I could spoof headers) my hostgator smtp server.

    This resolved the issue.

    评论

报告相同问题?

悬赏问题

  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测