为什么我会遇到这个PHP Mailer语言错误?
我在PHP中遇到以下错误: 无法加载语言字符串:收件人\u失败 我的代码是:为什么我会遇到这个PHP Mailer语言错误?,php,phpmailer,Php,Phpmailer,我在PHP中遇到以下错误: 无法加载语言字符串:收件人\u失败 我的代码是: $mail = new PHPMailer(); $mail->IsSMTP(); // telling the class to use SMTP $mail->Host = "mail.escentrics.com"; // SMTP server $mail->From = "example@esce
$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.';
错误消息意味着PHPMailer找不到其语言翻译文件来处理真正的错误消息。触发此问题的原因很可能是“收件人”地址不正确,这意味着
$Email
很可能不正确:空白、格式错误等。。。请记住,PHP变量区分大小写,因此请确保它实际上是带有大写字母E的$Email
(并包含有效的电子邮件地址),而不是$Email
或类似的内容。@Andro,发生了什么错误?$Email
变量的大小写是什么?它只是变量名。我应该使用的变量是$email。这是我的错。