you're reading...

Moodle Error: Could not instantiate mail function

We came across an error with our Moodle install when trying to send user registration emails. When clicking the link we got the error ‘Could not instantiate mail function. ERROR: Could not instantiate mail function’

We’re running Moodle on a Windows Server 2008 R2 box, so we had to do a few workarounds to get it working. The database is also running on Microsoft SQL 2008 R2 and not MySQL.

This error proved to be a simple one to fix, it turned out we didn’t configure the smtphosts value in the database table mdl_config. Running the SQL script below against dbo.mdl_config fixed it for us (change mymailserver.com to your mail servers details)

UPDATE mdl_config SET value=‘mymailserver.com’ WHERE name=‘smtphosts’;

Hope this helps!


No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: