email problems

email problems

by randall watson -
Number of replies: 10
I'm having no luck getting Moodle to send email at all.

Any help?
Thanks,
RLDWatson
Average of ratings: -
In reply to randall watson

Re: email problems

by Mark Gillingham -
I am having problems too. I have a fresh 1.2.1 installation on Debian Woody. I've posted elsewhere in this forum about the details.

After reading the forum, I noticed some good advice. For instance, if PHP will not send mail, try your own smtp host. If you can send mail from your own server, it might be configured as "localhost:25". Some have noticed that the port number was necessary (e.g., 25). I've tried variations of this for my situation to no avail. In my situation, OSCommerce is able to send mail using the default PHP settings, but Moodle 1.2.1 is not. That's beyond me.
In reply to Mark Gillingham

Re: email problems

by Zbigniew Fiedorowicz -
Try debugging with the directions given in the following two posts:
http://moodle.org/mod/forum/discuss.php?d=4721#22099
http://moodle.org/mod/forum/discuss.php?d=4721#22111
Also read the entire discussion.
In reply to Zbigniew Fiedorowicz

Re: email problems

by randall watson -
I've spent the last two days doing exactly what is described in the links provided to no avail.

I added the debug line, nothing.
In reply to randall watson

Re: email problems

by Zbigniew Fiedorowicz -
Try subscribing yourself to a forum, post some messages to the forum, wait for editting time to expire, then go to
http://yoursite/admin/cron.php
and see what error messages appear.
In reply to Zbigniew Fiedorowicz

Re: email problems

by randall watson -
Here's the cron report I got after doing what you suggested:

Server Time: Thu, 8 Apr 2004 10:02:47 -0500


Processing post 6
ERROR:
Error: mod/forum/cron.php: Could not send out mail for id 6 to user 1 (rwatson2@unl.edu) .. not trying again.
.... mailed to 0 users.

Processing post 7
ERROR:
Error: mod/forum/cron.php: Could not send out mail for id 7 to user 1 (rwatson2@unl.edu) .. not trying again.
.... mailed to 0 users.

Processing post 9
ERROR:
Error: mod/forum/cron.php: Could not send out mail for id 9 to user 1 (rwatson2@unl.edu) .. not trying again.
.... mailed to 0 users.

Processing post 8
ERROR:
Error: mod/forum/cron.php: Could not send out mail for id 8 to user 1 (rwatson2@unl.edu) .. not trying again.
.... mailed to 0 users.
Running clean-up tasks...
Running backups if required...
Checking backup status...INACTIVE
Backup tasks finished
Cron script completed correctly
Execution took 3.333482 seconds
In reply to randall watson

Re: email problems

by Zbigniew Fiedorowicz -
I don't think you followed these instructions of Martin's:

You should see more debugging info than that ... try editing lib/moodlelib.php, find the email_to_user() function and add this line
    $mail->SMTPDebug = true;

before this line
    if ($mail->Send()) {

When I add this line to my moodlelib.php, I get a lot more messages from admin/cron.php:

Processing post 1938
SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is "220 hermes.math.ohio-state.edu ESMTP Sendmail 8.12.10/8.12.10; Thu, 8 Apr 2004 11:35:39 -0400
"
SMTP -> get_lines(): $data is "220 hermes.math.ohio-state.edu ESMTP Sendmail 8.12.10/8.12.10; Thu, 8 Apr 2004 11:35:39 -0400
"
SMTP -> FROM SERVER:
220 hermes.math.ohio-state.edu ESMTP Sendmail 8.12.10/8.12.10; Thu, 8 Apr 2004 11:35:39 -0400
SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is "250-hermes.math.ohio-state.edu Hello webwork2.math.ohio-state.edu [140.254.92.37], pleased to meet you
"
SMTP -> get_lines(): $data is "250-hermes.math.ohio-state.edu Hello webwork2.math.ohio-state.edu [140.254.92.37], pleased to meet you
"
SMTP -> get_lines(): $data was "250-hermes.math.ohio-state.edu Hello webwork2.math.ohio-state.edu [140.254.92.37], pleased to meet you
"
SMTP -> get_lines(): $str is "250-ENHANCEDSTATUSCODES
"
+ many more lines.


In reply to Zbigniew Fiedorowicz

Re: email problems

by randall watson -
I have set up the debug line just as directed.

However, I found online a unix script that turns on sendmail for me, and everything is now working fine!

Thanks for all your suggestions, much appreciated!
RLDWatson
In reply to randall watson

Re: email problems

by Dave Kennedy -
Would you mind sharing the specifics of your new found knowledge - my magic wand is not working and I can't wave it today.
In reply to Dave Kennedy

Re: email problems

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
He probably means something like

/etc/init.d/sendmail start

This could all have been avoided by specifying a suitable SMTP server in the site settings by the sound of things. Beware: in a company/academic network your local sendmail server may be blocked from the outside world by a firewall so make sure you can send to external addresses if you need to do that!