为什么我收到此PHP Mailer语言错误?

时间:2011-11-04 03:26:03

标签: php phpmailer

我在PHP中遇到此错误:

语言字符串无法加载:recipients_failed

我的代码是:

$mail = new PHPMailer();
                $mail->IsSMTP(); // telling the class to use SMTP
                $mail->Host = "mail.escentrics.com"; // SMTP server
                $mail->From = "example@escentrics.com";
                $mail->AddAddress($Email);

                $mail->Subject = "Tradeworx Account Confirmation";
                $mail->Body = "Hello $fname,

Account Information:
Username/Email: $email
Password: $password


To activate you account just go to this link: http://192.168.1.101/tradeworx/TWWebsite/index.php?page=Confirmation&id=$userid&confirmationcode=$confirmcode";
                $mail->WordWrap = 100;

                if(!$mail->Send())
                {
                   echo 'Message was not sent.';
                   echo 'Mailer error: ' . $mail->ErrorInfo;
                }
                else
                {
                   echo 'Message has been sent.';

1 个答案:

答案 0 :(得分:2)

错误消息表示PHPMailer无法找到真实错误消息的语言翻译文件。触发这种情况的原因很可能是“To”地址错误,这意味着很可能$Email不正确:空白,格式不正确等等......请记住,PHP变量区分大小写,因此请确保它实际上是{ {1}}使用大写字母E(并包含有效的电子邮件地址),而不是$Email或类似的。