SMTP Error: Could not authenticate

博客详细描述了在Moodle 2.0版本中遇到的SMTP邮件发送失败问题,特别是当论坛帖子发送时,订阅用户无法收到邮件。作者通过在moodlelib.php文件中添加一行代码解决了这一问题,即设置$mailer->SMTPSecure为tls。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

HI

We currently have three Moodle 2.0 (build 20110209) installations and receive the 'SMTP Error:Could not authenticate' and none of the subscribed users receive an email when a forum post is sent from these installations.  I, as an admin, recieve the following message within an email:

Insert into log table failed at Wednesday 16th of February 2011 11:57:28 AM.

 It is possible that your disk is full.

The failed query parameters are:

array (

  'time' => 1297857448,

  'userid' => '2',

  'course' => '1',

  'ip' => '10.10.10.14',

  'module' => 'library',

  'cmid' => 0,

  'action' => 'mailer',

  'url' => NULL,

  'info' => 'ERROR: SMTP Error: Could not authenticate.',

)

When I look at the cron log, it has the following message:

<br />SMTP Error: Could not authenticate.
ERROR: SMTP Error: Could not authenticate.
++ Error: Could not insert a new entry to the Moodle log ++
* line 1691 of /lib/datalib.php: call to debugging()
* line 4742 of /lib/moodlelib.php: call to add_to_log()
* line 63 of /message/output/email/message_output_email.php: call to email_to_user()
* line 152 of /lib/messagelib.php: call to message_output_email->send_message()
* line 644 of /mod/forum/lib.php: call to message_send()
* line 87 of /lib/cronlib.php: call to forum_cron()
* line 79 of /admin/cron.php: call to cron_run()
</pre>++ Error calling message processor email ++
* line 153 of /lib/messagelib.php: call to debugging()
* line 644 of /mod/forum/lib.php: call to message_send()
* line 87 of /lib/cronlib.php: call to forum_cron()
* line 79 of /admin/cron.php: call to cron_run()
Error: mod/forum/lib.php forum_cron(): Could not send out mail for id 36 to user 28 (blahblah@somemailco.co.uk) .. not trying again.
post 36: another test
0 users were sent post 36, 'another test'

 

We have Moodle v 1.9 on the same server with the exact same SMTP settings and this install is sending emails accordingly.

Ali

-----------------------------------------------------------------------------

Hi, I just solved my problem and want to share the solution with you.

 

It was a line addition to moodlelib.php  ( in the lib directory)

Find the line :

$mailer->IsSMTP();

and under this line , insert

$mailer->SMTPSecure = "tls";

if you use TLS of course. After this, e-mail system was working without any problems.

I hope it helps. smile

转载于:https://www.cnblogs.com/laipDIDI/articles/2225632.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值