PHP Mailer错误:Mailer错误-必须提供至少一个收件人电子邮件地址 [英] PHP Mailer Error: Mailer Error - must provide at least one recipient email address

查看:149
本文介绍了PHP Mailer错误:Mailer错误-必须提供至少一个收件人电子邮件地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了php mailer脚本问题.使用mamp脚本可以正常工作,但是在服务器上我收到一个错误消息(我省略了敏感信息).

I'm having and an issue with php mailer script. Using mamp the script works, but on the server I get an error (I've omitted sensitive info).

无效的地址:[有效的电子邮件]邮件错误:您必须 提供至少一个收件人电子邮件地址."

"Invalid address: [valid email] Mailer Error: You must provide at least one recipient email address."

这里是我的代码:

require_once("includes/phpmailer/class.phpmailer.php");

    $mail = new PHPMailer();
    $mail->IsSMTP();

    $mail->SMTPAuth   = true;                  
    $mail->Host       = "smtp.emailsrvr.com"; 
    $mail->SMTPDebug  = 2;                    
    $mail->Port       = 25;                    
    $mail->Username   = "test@test.com"; 
    $mail->Password   = "test";

    $mail->Subject = "Subject";

    $mail->SetFrom($_POST['email'], $_POST['name']);
    $mail->AddReplyTo($_POST['email'], $_POST['name']);

    $address = "test@test.com";
    $mail->AddAddress($address, "name");

    $body = "<p>test</p>";

    $mail->MsgHTML($body);


    if(!$mail->Send()) {
      echo "Mailer Error: " . $mail->ErrorInfo;
    } else {
      echo "Message sent!";
    }

如果有帮助,我正在使用机架式电子邮件应用程序.

If it helps, I am using the rackspace email apps.

不幸的是,我对php或服务器设置不是很精明,所以如果有人可以帮忙,那就太好了!

Im not very savy with php or server setups unfortunately so if anyone can help that would be great!

推荐答案

所以我在这里没有运气,但是我现在知道问题出在服务器邮件设置而不是脚本.

So i had no luck here, but I now know the issue stems from server mail settings rather then the script.

最后,我只是去使用邮戳.

In the end I just went to using postmark.

这篇关于PHP Mailer错误:Mailer错误-必须提供至少一个收件人电子邮件地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆