CRON.PHP says "Could not send out mail"

CRON.PHP says "Could not send out mail"

by Sam Mudle -
Number of replies: 4
When I run cron.php, everything is working except email. I'm using the default php method of sending email, but i get the following messages:

Processing post 499ERROR:
Error: mod/forum/cron.php: could not send out mail for id 499 to user 1 (jim.smith@yahoo.com) .. not trying again.
Error: mod/forum/cron.php: Could not send out mail for id 499 to user 12 (john@hotmail.com) .. not trying again.
Error: mod/forum/cron.php: Could not send out mail for id 499 to user 3 (sue@yahoo.com) .. not trying again.
... mailed to 0 users.

I've tested this with subscribing everyone to forum posts, and this is what I get every day when running cron. No one gets email.sad

Any suggestions on how to discover the cause? I'm running on Windows 2000 server with Moodle 1.4 and EasyPHP1-7.
Average of ratings: -
In reply to Sam Mudle

Re: CRON.PHP says "Could not send out mail"

by Sam Mudle -
bump
In reply to Sam Mudle

Re: CRON.PHP says "Could not send out mail"

by Timothy Takemoto -

Dear Jeremy W.

I am sorry there are no suggestions.

Incorrect SMTP settings in the site administration? When in doubt leave them blank since the resident php routines generally work fine.

Or conversely, perhaps some antispam measure in your network prevents php scripts from sending out mail. This is the case where I am so I have to use SMTP. But then I think that the cron does not realise that the mails are not getting out.

I see that Eric Hagley asked the same question recently without response. Since some of the mails are being sent out in his case, that would seem to invalidate the suggestions above. Hmm...thoughtful

Looking at the code that generate this error message (in moodle/mod/forum/lib.php calling email_to_user in moodle/lib/moodlelib.php) it seems that it happens when the user is "empty" (probably meaning not enrolled on course) perhaps when the user has selected not to be sent mail (emailstop is selected) or in other cases. In the case of those "other cases," the following is written to the site logs.  

add_to_log(SITEID, 'library', 'mailer', $FULLME, 'ERROR: '. $mail->ErrorInfo);

Tim

In reply to Timothy Takemoto

Re: CRON.PHP says "Could not send out mail"

by Sam Mudle -
Yeah I've searched the forums, and basically no one has had a problem using the default method where cron.php knows that the emails aren't going out.  So it's something wierd with my specific installation. sad

I'm going to reinstall moodle on a new test server, so we'll see what's happening before I do a restore.

Thanks Tim for the reply.
In reply to Sam Mudle

Re: CRON.PHP says "Could not send out mail"

by W Page -
Hi Jeremy W!,

Were you ever able to resolve this problem.  If you did?  What did you do?

WP1