Moodle Forums - No Email Sent

Moodle Forums - No Email Sent

by James Rivers -
Number of replies: 3

Moodle Version - 3.5,  PHP Version 7.2.10

Moodle is installed on a service provider siteground. 

I have long since wondered if this works, but I wanted to get to the bottom of why this is just not working. 

Course X, has a Forum - announcements and news as per the norm.  Subscription method is auto (it was forced, changed in testing). No new forum post is being emailed to the enrolled students.

Student criteria are set to receive forum post in an email when offline and online. 

I have started to look at the cron jobs, if that may be an issue.  I have set a cron job as follows: (note I have removed site path in this post-security)

wget -q -O /dev/null  <site path> /admin/cli/cron.php

Can I get some guidance from the moodle oracle on this? 



Average of ratings: -
In reply to James Rivers

Re: Moodle Forums - No Email Sent

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Some random thoughts...

* does mail work at all? 

* is your Cron running? Check the Scheduled tasks page. Is everything getting run that should be?

* Are you sure? Is the student subscribed to the forum? Is the student subscribed to the particular thread (been caught out by that one!)

* If it looks like they should be getting mail and mail seems to work elsewhere, do you have access to mail logs? Can you see if the MTA processed the mail for that student?

In reply to Howard Miller

Re: Moodle Forums - No Email Sent

by James Rivers -

Afternoon Howard, thanks for the prompt reply to this thread.

  •  does mail work at all? 
    • I can send emails to students via the message page in Moodle -  CHECK


  •  is your Cron running? Check the Scheduled tasks page.
    • Error noted - 
      Execute scheduled task: Forum mailings and maintenance jobs (mod_forum\task\cron_task)
      ... started 13:03:52. Current memory use 9.4MB.
      Processing user 132
      ... used 51 dbqueries
      ... used 0.10195398330688 seconds
      Scheduled task failed: Forum mailings and maintenance jobs (mod_forum\task\cron_task),Coding error detected, it must be fixed by a programmer: Function cron_setup_user() cannot be used in normal requests!


  • Is everything getting run that should be?
    • Yes, i believe so.  - 
  • Are you sure? Is the student subscribed to the forum? Is the student subscribed to the particular thread (been caught out by that one!)
    • Yes - test student accounts same as used in messaging via Moodle. 
  •  If it looks like they should be getting mail and mail seems to work elsewhere, do you have access to mail logs?
    • Not sure where the mail logs are located. Will investigate and review the logs. 
  • Can you see if the MTA processed the mail for that student?
    • MTA? 
I will review the above error, mails logs included and post back a reply.  All helo greatly appreciated.