Unable to Send Email After Upgrading to Moodle 3.0

Unable to Send Email After Upgrading to Moodle 3.0

by Bill McNutt -
Number of replies: 12

I have recently upgraded my moodle server from about 2.5 (sorry didn't note the specifics) to Moodle 3.0.3+ (Build: 20160504).

mssql (Microsoft SQL Server 2008 R2 - 10.50.1617.0) version 10.0 is required and you are running 10.50.1617

php version 5.4.4 is required and you are running 5.5.8

The server is MS-Windows 2008 R2 Standard (64 bit) and is running IIS 7.

The system will no longer send emails for password resets or new user self-registration.

The user does not get an error message, but nothing ever arrives in the mailbox.

Average of ratings: -
In reply to Bill McNutt

Re: Unable to Send Email After Upgrading to Moodle 3.0

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

There have been some issues with mail settings after that kind of jump.  Go in and check your email settings in the messaging settings.  Also, do you have cron set up and running?  

Average of ratings: Useful (1)
In reply to Emma Richardson

Re: Unable to Send Email After Upgrading to Moodle 3.0

by Bill McNutt -

Emma - cron does, indeed, look "funny."  My Task History for WIndows shows that the job ran to completion five minutes ago, but I got in the habit of piping the log to a file that just over-writes every time it runs, just as a check.

THAT file has not been updated since January. (Before my upgrade.) Accordingly, I ran cron manually in a cron window, and NOW there is "stuff" to see.


The relevant log entry is here:

... started 16:43:55. Current memory use 38.5MB.

Outdated or missing info about available updates, forced fetching ... sending no

tifications ... Error: lib/moodlelib.php email_to_user(): Could not instantiate

mail function.

++ Error calling message processor email ++

* line 127 of \lib\classes\message\manager.php: call to debugging()

* line 88 of \lib\classes\message\manager.php: call to core\message\manager::sen

d_message_to_processors()

* line 229 of \lib\messagelib.php: call to core\message\manager::send_message()

* line 812 of \lib\classes\update\checker.php: call to message_send()

* line 625 of \lib\classes\update\checker.php: call to core\update\checker->cron

_notify()

* line 213 of \lib\classes\update\checker.php: call to core\update\checker->cron

_execute()

* line 49 of \lib\classes\task\check_for_updates_task.php: call to core\update\c

hecker->cron()

* line 75 of \lib\cronlib.php: call to core\task\check_for_updates_task->execute

()

* line 61 of \admin\cli\cron.php: call to cron_run()

Error: lib/moodlelib.php email_to_user(): Could not instantiate mail function.

++ Error calling message processor email ++

* line 127 of \lib\classes\message\manager.php: call to debugging()

* line 88 of \lib\classes\message\manager.php: call to core\message\manager::sen

d_message_to_processors()

* line 229 of \lib\messagelib.php: call to core\message\manager::send_message()

* line 812 of \lib\classes\update\checker.php: call to message_send()

* line 625 of \lib\classes\update\checker.php: call to core\update\checker->cron

_notify()

* line 213 of \lib\classes\update\checker.php: call to core\update\checker->cron

_execute()

* line 49 of \lib\classes\task\check_for_updates_task.php: call to core\update\c

hecker->cron()

* line 75 of \lib\cronlib.php: call to core\task\check_for_updates_task->execute

()

* line 61 of \admin\cli\cron.php: call to cron_run()

done

... used 11 dbqueries

... used 2.2522249221802 seconds

Scheduled task complete: Check for updates (core\task\check_for_updates_task)

In reply to Emma Richardson

Re: Unable to Send Email After Upgrading to Moodle 3.0

by Perry Way -

To add to Emma's response, IIRC, there was a difference to how emails are sent between 2.5.x and 2.7.x, so indeed jumping from 2.5.x to 3.0.x would likely mean the settings to the new way of sending emails are likely empty.

In reply to Bill McNutt

Re: Unable to Send Email After Upgrading to Moodle 3.0

by Usman Asar -
Picture of Plugin developers Picture of Testers

Bill, it's not that big of a jump to consider plenty possibilities, but Moodle 2.6 and lower versions required PHP 5.3, whilst 2.7 and higher required PHP 5.4, so have you as well upgraded your PHP? if this is the case then likely your CRON isnt setup properly in Scheduled Tasks. else do run CRON manually through web interface and see if that still doesn't sends out emails, meanwhile checking your settings in moodle for emails.

In reply to Usman Asar

Re: Unable to Send Email After Upgrading to Moodle 3.0

by Bill McNutt -

Usman -

My "Environment" report says: version 5.4.4 is required and you are running 5.5.8.  I have not upgraded PHP recently.


I have manually run CRON from the command line, and it is still not sending out emails. Nor am I getting any error messages in the CRON log.

In reply to Bill McNutt

Re: Unable to Send Email After Upgrading to Moodle 3.0

by Perry Way -

Bill, in the Site Administration menu expand or navigate to:

Plugins -> Message Outputs -> Email

Are your settings there correct? I'm thinking since you upgraded from 2.5.x all the way to 3.0.x you might have jumped past the old way and the new way of where the outbound email settings are retained. If your settings are empty, fill them in and re-run your "chron" and see if that fixes things.

In reply to Perry Way

Re: Unable to Send Email After Upgrading to Moodle 3.0

by Bill McNutt -

Perry,

My settings look correct.


Bill

In reply to Bill McNutt

Re: Unable to Send Email After Upgrading to Moodle 3.0

by Just H -
Maybe worth trying the email test plugin; it might highlight any issues.
In reply to Bill McNutt

Re: Unable to Send Email After Upgrading to Moodle 3.0

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Are you using the builtin php mail function or are you using an external smtp server?  You might try switching to see if an external email works - that would narrow it down to possibly an issue with your server mail.

In reply to Emma Richardson

Re: Unable to Send Email After Upgrading to Moodle 3.0

by Bill McNutt -

Thank you for your follow-up.  

No, I am using an external SMTP server.  The system worked reliably at previous moodle levels (through 2.7, I think).  


I am using Windows 2008 R2, IIS 7 and have successfully sent email using the SMTP server via powershell.

In reply to Bill McNutt

Re: Unable to Send Email After Upgrading to Moodle 3.0

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Can you post screenshots - sensitive info blacked out of course!

In reply to Bill McNutt

Re: Unable to Send Email After Upgrading to Moodle 3.0

by Ron Meske -
Picture of Particularly helpful Moodlers

Hi Bill,

I ran into a similar problem when upgrading to 2.7.  

The email address for the support contact was blank and by default was using a different email then the sending account.  I set the email address to the same address used for the sending account. Emails are now being sent again.

Hope that helps.

Ron