我已成功使用本地主机中的 gmail 设置了电子邮件设置,并且我的糖实例正在发送测试邮件。我还完成了 cron 作业设置并对其进行了测试。当我尝试在无法发送的 cron 作业中发送电子邮件时,就会出现问题。我正在使用的基本代码是
require_once('include/SugarPHPMailer.php');
$emailObj = new Email();
$defaults = $emailObj->getSystemDefaultEmail();
$mail = new SugarPHPMailer();
$mail->setMailerForSystem();
$mail->From = $defaults['email'];
$mail->FromName = $defaults['name'];
$mail->Subject=from_html($bean->name);
$mail->Body="hello this is testing ....!";
$mail->prepForOutbound();
$mail->AddAddress('abc@yahoo.com');
@$mail->Send();
致命日志中显示以下错误。
09/24/12 10:58:07 [4560][1][FATAL] SMTP -> ERROR: EHLO not accepted from server. Code: , Reply:
09/24/12 10:58:07 [4560][1][FATAL] SMTP -> ERROR: HELO not accepted from server. Code: , Reply:
09/24/12 10:58:07 [4560][1][FATAL] SMTP -> ERROR:AUTH not accepted from server. Code: Reply:
09/24/12 10:58:07 [4560][1][FATAL] SugarPHPMailer encountered an error: SMTP Error: Could not authenticate.
09/24/12 10:58:07 [4560][1][FATAL] SugarPHPMailer encountered an error: SMTP Error: Could not connect to SMTP host.
09/24/12 10:58:07 [4560][1][FATAL] SugarPHPMailer encountered an error: An outgoing mail server is not configured to send emails. Please configure an outgoing mail server or select an outgoing mail server for the mail account that you are using in Settings >> Mail Account.
有时它会给出以下一个,
09/24/12 11:01:07 [832][1][FATAL] SugarPHPMailer encountered an error: Language string failed to load: tls
有人可以帮忙吗?