Forum E-mails Not Sending

Forum E-mails Not Sending

by James Phillips -
Number of replies: 18
Hello everybody,

I recently built a test site to replace my existing site (which was moodle 1.91) using 1.94. When I put the test site in place the forum e-mails were no longer sent out (although a single copy was sent to the administrator). I found a bug that suggested this was fixed for 1.95 so I upgraded to 1.95 but the problem is still there. This is driving me a little crazy as it makes no sense at all and was working fine on the old version. Does anybody have any suggestions?

Best regards,

James Phillips

http://www.horsefrog.com
Average of ratings: -
In reply to James Phillips

Re: Forum E-mails Not Sending

by Fahmy Babjee -

Hi James

The bug in question is only resolved in 1.9.5 if you're not using php 5.  I was using php 4.3.9, and upgrading to 1.9.5 solved the forum email issue.

Perhaps you'd like to try to isolate the problem.

  • post a forum message and tick mail now. then run cron manually to see what sort of messages appear while processing your new forum post
  • see if the location of the forum affects whether any mail get sent out, i.e. if the forum is in the site front page or if within another course
  • are there subscribers to the forum besides yourself/admin? did you allow everyone to choose? or did you force subscription? again tick mail now and see the messages generated by moodle when cron runs forum_cron.
  • you may have to create dummy accounts and assign them to your forum test course to see if they receive emails
  • check settings for email server
  • try different forum settings / types
  • does password reset via email work? if it does then the problem doesn't lie within your email server settings, but probably elsewhere

Hope this helps.

In reply to Fahmy Babjee

Re: Forum E-mails Not Sending

by James Phillips -
I ran cron manually and the forum is simply not sending out the e-mails. This worked fine on the site before the upgrade which is what is puzzling me the most.
In reply to James Phillips

Re: Forum E-mails Not Sending

by Fahmy Babjee -

Err I don't claim to be an expert, but you probably need to tell us exactly what the cron output was before we can proceed further... what sort of error messages appeared (if any)?

In reply to Fahmy Babjee

Re: Forum E-mails Not Sending

by Bronwen Campbell -

I'm having the same problem, although it seemed to work for a while after upgrading to 1.9.4, then suddenly stopped - I thought it was due to the known bug of including a link in the post, but now it doesn't work with any post or message.

I've tried changing from using the default PHP mail to SMTP, and it does change the error message I get from the cron output, but the result is the same - no e-mail.

Error from cron output when trying with SMTP is Sending ERROR: SMTP Error: The following recipients failed:

Error with PHP default is as follows: Sending ERROR: Could not instantiate mail function.
Error: mod/forum/cron.php: Could not send out mail for id 49 to user 2

I'm using PHP5.2.5, Moodle 1.9.4 on a Linux hosted server (Siteground).

I will try upgrading to 1.9.5, but other posts suggest that the forum mail error is occurring in 1.9.5 as well. Hope someone can help.

Regards, Bronwen

In reply to Bronwen Campbell

Re: Forum E-mails Not Sending

by Bronwen Campbell -

Further update -have dredged through the new terms and conditions at Siteground and discovered that they have a maximum of 40 recipients per e-mail. So I can get messaging e-mails to work as long as it stays under 40.

However, have not solved forum e-mails even with only one user subscribed to a test forum. Any help on this appreciated.

Regards, Bronwen

In reply to Bronwen Campbell

Re: Forum E-mails Not Sending

by Fahmy Babjee -

Bronwen,

I understand the frustration, I had several weeks of it! Everything's fine on my production site now.  I'm using php 4.3.9 with the latest moodle 1.9.5 install.

In one of my earlier test runs, I tried setting up a dummy account and testing if self-resets of password via email works.  And it did! So I knew that it wasn't my smtp settings or my mail server that was causing the problem. It later turned out that it was the forum module itself that was bugged, and the latest 1.9.5 has already resolved that for my site.

Perhaps you'd like to try to do the same.  It's very difficult to identify the root of the problem without first trying to isolate the error.

In reply to Bronwen Campbell

Re: Forum E-mails Not Sending

by Shaun Kellogg -
I'm a Siteground moodle user as well and am having trouble with my 1.9.4 site. It seems to now be affecting my 1.8+ site as well now, though I had no troubles in early June. Is this a recent policy change?
In reply to Shaun Kellogg

Re: Forum E-mails Not Sending

by Shaun Kellogg -
I set up a demo site with only myself as user and am not receiving any emails from that one either. 1.9.4 though siteground.com.
In reply to Shaun Kellogg

Re: Forum E-mails Not Sending

by Bronwen Campbell -
I believe that it is because Siteground upgraded to PHP version 5 and above, which seems to cause a problem with the forum e-mails if using the PHP mailer. You can try using the SMTP mail option, with port 2525. I'm still occasionally having problems with the mail, but it works most of the time - you need to keep an eye on the error logs to see whether a particular forum post has not gone out to some users - it will show up under reports as forum mail error - you can then send that user an ordinary message to let them know to look at a post - bit of a pain, but I can't seem to get rid of that intermittant problem.
In reply to Bronwen Campbell

Re: Forum E-mails Not Sending

by Roger Kenner -
I have found the solution, with a little help from the Siteground technical support. It is not all that obvious at first, but makes sense in the end.

One must set up at least one bonafide email account on the site, so as to be able to authenticate with Siteground's SMTP. (The native php method does not work, as cron.php does not have a sufficient level of permission to run it).

Assume a domain abc.com
an email account xx@abc.com
with password yyy

Here are the Email settings that matter:
SMTP hosts: abc.com
SMTP Username: xx@abc.com
SMTP password: yyy

(Now here's the tricky part!)
No-replay address: xx@abc.com ( I am not certain it must be the same, but it must be a bonafide email address on your domain.)
Support name: xx@abc.com ( I am not certain this field figures in the outcome)
Support email: xx@abc.com

Why these two other fields? Apparently the info from these fields (Default being: no-reply@domain.com and admin@admin.com) finds its way into the FROM: field of the mailer. But Siteground does not allow its SMTP to send out mail whose FROM: address is not a bonafide Siteground email address (I am not 100% certain it has to be from the same domain, but I would guess so.). Such a policy probably prevents people from using their SMTP to spoof other people's email.

This policy may have been somewhat recent. I seem to recall my Moodle on Siteground could and did sent out forum mail in the past. I did a workshop for beginners and came home to find tons of email messages from their forums. My support email address was one not on siteground. That is probably what killed it.

I hope this will help others.

Roger Kenner



In reply to Bronwen Campbell

Re: Forum E-mails Not Sending

by Peter Evans -

I posted this in another thread ... but hopefully putting all our info together will help

I am also on siteground and have a Moodle 1.9.4 site (build 20090128) and emails are not being sent out from subscribed forums or when someone enrolls in the course.

I have checked the following:

  • I am using php 5.1.6
  • emails are send out when messages are sent and when the a password reset it requested
  • automatic cron is working
  • the person has enabled their email
  • the person is subscribed to the forum
  • it is also not working for the news form
  • the person is enrolled in the course
  • in SITE ADMIN > SERVER > EMAIL > I am using the PHP default method of sending emails and the other defaults
  • when I run cron manaually, the course welcome emails are sent and I see the the output at the bottom of this messages BUT the forum posts are still not received bu users


If someone can suggest any other things I need to check to troubl shoot the form emails I (and others) would be VERY grateful.

Peter Evans


<!--StartFragment-->Server Time: Sat, 01 Aug 2009 21:13:29 -0500
Starting activity modules
Processing module function assignment_cron ...done.
Processing module function chat_cron ...done.
Processing module function forum_cron ...Processing user 314
Processing user 315
Sending post 231: another note send to news in tester (12:11)
Processing user 317
Sending post 231: another note send to news in tester (12:11)
2 users were sent post 231, 'another note send to news in tester (12:11)'

In reply to Peter Evans

Re: Forum E-mails Not Sending

by Bronwen Campbell -

Hi, thought I had solved the problem by going to SMTP for sending e-mails (need to use port 2525 for Siteground).

And it did seem to work for a while, but latest cron output shows that only some users are receiving the forum e-mails, and this seems to be random and inconsistent even within the same forum. No apparent reason for why some users did not receive the e-mail - an extract from the output from the cron job was as follows (with user details removed) (out of 26 subscribers to the forum):

Sending ERROR: SMTP Error: The following recipients failed: XXX@bigpond.com.au
Error: mod/forum/cron.php: Could not send out mail for id 126 to user 54 (XXX@bigpond.com.au) .. not trying again.
24 users were sent post 126, 
19 users were sent post 127,
If anyone has any suggestions as to why this might be happening (user e-mails were valid and enabled), I'd certainly appreciate your feedback. 
In reply to Peter Evans

Re: Forum E-mails Not Sending

by Daniel Genz -
If you haven't figured it out yet, here's how:

You have to configure your SMTP server to relay messages, and Exchange 2007 usually has this type of issue, here how to resolve:

Here is step-by-step how to create anonymous recipient relay connector
1. Create a new Receive Connector with the Custom Usage Group
2. For Remote Network Settings default values are 0.0.0.0 -255.255.255.255, where you can add IP address range (for example if you have clients who are talking with exchange on port 25), or/and specific IP Address of the remote server that requires relaying permissions.
3. Once the new Custom Receive Connector is created, go into the properties of this connector
4. Go to the Permission Groups Tab > check Anonymous Users
1. To activate Anonymous users to use this connector for relaying, you must issue the following command using PowerShell :
Get-ReceiveConnector "Receive connector name" | Add-ADPermission -User "NT AUTHORITY\ANONYMOUS LOGON" -ExtendedRights "ms-Exch-SMTP-Accept-Any-Recipient"
In reply to Peter Evans

Re: Forum E-mails Not Sending

by deepak gupta -
I am having the exact same problem as Peter Evans. Can you please tell me if you figured out the solution for this
In reply to deepak gupta

Re: Forum E-mails Not Sending

by Peter Evans -

I ended up solving it as others have done.

  • establish a real email account on the server
  • set the SMTP HOSTS to point to that server
  • set the SMTP USERNAME to that account
  • enter the SMTP PASSWORD
  • Set the SMTP SESSION LIMIT to 1

and all is OK from then on

PeterEvans

In reply to Peter Evans

Re: Forum E-mails Not Sending

by Wim Torbeyns -
I've read this thread and tried most of the proposed solutions (but I don't know anything about Cron). Personal messages are e-mailed OK. I'm using the account we bought for our newsletter as SMTP host. This account is working. I even put in a real e-mail address in the 'no-reply' field. Still no e-mails from the forum.

Moodle: 1.9.7+ (Build: 20091202)
PHP: 5.1.2

Can anyone help me out with additional troubleshooting?
In reply to Wim Torbeyns

Re: Forum E-mails Not Sending

by Wim Torbeyns -
OK. Solved. The problem was "(but I don't know anything about Cron)". Setting up the Cron job is definitely not a straightforward task. I had to combine the information I found on this site with the information provided by our host to get this working. Not very user friendly, but it does the trick.
In reply to Wim Torbeyns

Re: Forum E-mails Not Sending

by Athanassios Triantafyllidis -
Well, I totally agree with you as far as complexity is concerned and I myself have no clue about Cron, so if you managed to find a way out of all these posts, can you share what you did step by step so that those of us still in trouble may achieve a solution.

Thanks in advance!