我收到此错误(phplist email not sent webmaster@fall-pac.com : Called Mail() without being connected)因为升级我的 phplist 没有其他任何变化我已经从实际的 smtp 邮箱发送了一封测试电子邮件,它可以正常工作我知道它不是电子邮件地址,我认为它一定是我的 config.php 文件中的东西,但似乎找不到可能导致问题的原因,任何帮助都会很棒,请查看我的 config.php放在这里http://pastebin.com/CjRKdu5H
问问题
353 次
1 回答
0
<?php
require("PHPMailer/class.phpmailer.php");
$mail = new PHPMailer(); // create a new object
$mail->IsSMTP(); // enable SMTP
$mail->SMTPDebug = 0; // debugging: 1 = errors and messages, 2 = messages only
$mail->SMTPAuth = true; // authentication enabled
$mail->SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for GMail
//if $mail->SMTPSecure = 'tls';
// use $mail->Port = 465;
$mail->Host = 'smtp.gmail.com';
$mail->Port = 465;
$mail->Username = 'username';
$mail->Password = 'password';
$mail->SetFrom('xyz@some.com', 'Testing');
$mail->Subject = 'Yii Test';
$mail->Body = "hello";
$mail->AddAddress('xyz@some.com');
if(!$mail->Send()) {
$error = 'Mail error: '.$mail->ErrorInfo;
return false;
} else {
echo $error = 'Message sent!';
return true;
}
?>
于 2014-08-27T05:21:23.330 回答