Automatic emails from forums, how do you set it up?

Automatic emails from forums, how do you set it up?

by Chris Neaves -
Number of replies: 13

I want to have automatic emails sent to participants like happens at moodle.org, how do I do it, is it already there??

All participants are subscribed to the forums, is it not autmatically working like this forum because I havent set up the smtp host in the settings?

thanks in advance

Average of ratings: -
In reply to Chris Neaves

Re: Automatic emails from forums, how do you set it up?

by John Gone -
Could you supply some more info? i.e. Server specs
In reply to John Gone

Re: Automatic emails from forums, how do you set it up?

by Antti Immonen -
I guess answer is cron.

I do it manually everytime i want that messages go to email addresses, because I yeat cant make an automatic script. sad

The cron is somekind of script that activates when i just click url address. http://myhost/moodle/admin/cron.php

Well, search for cron and try to learn, Good luck
In reply to Antti Immonen

Re: Automatic emails from forums, how do you set it up?

by Paula Edmiston -
Interestingly, crontab was one of the most difficult aspects of moodle for me to deal with. Even though I came to moodle thinking I understood how to use crontab, and was using it for a couple of other scheduling tasks, it turned out that my system needed a complicated approach to executing the cron.php and I had to get my brother help me to write a special script to automate it. I hope you don't run into the same complications I did!

When I was first learning about crontab I found a number of web pages that did a pretty good job of explaining what crontab is. A lot depends on whether your web server (the place where you run moodle) is on a Macintosh or Windows or some unix/linux machine. Also important is what kind of access you have to the server settings. If you have administrative access then I think it's easier to make the cron.php run automatically. I have my moodle in a virtual domain on a commercial web host where I do not have administrative access and I ended up having to install php in my own directory.

My moodle is running on FreeBSD (a dialect of unix) and these pages helped me:
http://weather.ou.edu/~billston/crontab/
http://webmasterworkshop.com/guides/crontab_guide.shtml

Martin has a great introduction to running the cron.php automatically from both unix and windows at
http://moodle.org/doc/index.php?file=install.html#cron

Here's some information on cron for Macintosh.
http://gargravarr.cc.utexas.edu/cron/


I think it's really important to understand the environment your moodle is running in: the operating system (unix, linux, freebsd, what version of windows, what version of Mac OS) and the web server (might be something like apache, iis, etc) and what kind of access/permisions you have on that server (are you an administrator with "root" access, a user with limited access).

On thing that can help a lot in understanding what environment you're working is a little php script that calls up a lot of this information. Attached is a little script I call "phpinfo.php" and if you will upload it to your server, say to the admin directory, and then call it in your web browser, you can get a lot of this information. For example, after uploading this script to your admin directory use this URL:
http://myserver.com/moodle/admin/phpinfo.php
best.
In reply to Chris Neaves

Re: Automatic emails from forums, how do you set it up?

by Don Hinkelman -
Picture of Particularly helpful Moodlers Picture of Plugin developers

If your server is a Mac OS X, you have to set up cron differently. You do not use the wget command that is in the Installation documentation.  Martin's explanation helped me....
"No, OS X doesn't have wget by default, but it does have curl. So, assuming Moodle is installed on the Mac where sendmail is working, try this command in your crontab (on any of your Macs):

/usr/bin/curl -s -o /dev/null http://yourserver.com/moodle/admin/cron.php

Also sendmail on Mac OS X needs some setting up to make it work.  Do a search for documentation at http://macdevcenter.com

In reply to Don Hinkelman

Re: Automatic emails from forums, how do you set it up?

by Gunther Dippe -
Working SendMail instructions for OSX can be found here
http://www.ish.com.au/show/article_sendmailOSX.html

I was successful using it smile
In reply to Gunther Dippe

Re: Automatic emails from forums, how do you set it up?

by Chris U -

You dont need to do that. PHP still sends mail using the mail() while using the AppleMailServer.

-Chris

In reply to Chris U

Re: Automatic emails from forums, how do you set it up?

by Gunther Dippe -
It didn't work on OSX 10.2.4 without fixing sendmail!

And I only applied the instructions according the referenced webpage(s).
In reply to Gunther Dippe

Re: Automatic emails from forums, how do you set it up?

by Chris U -

Hrmmm... Interesting.

Maybe its because I am running Mac OS X Server biggrin.gif

-Chris

In reply to Don Hinkelman

Re: Automatic emails from forums, how do you set it up?

by David Lamotte -
Being blessed with a linux environment, where cron and command line php can be taken for granted, it is easy to forget how hard and complex it can be for some people out there.

Perhaps it would be possible to include something like pseudo-cron (http://www.bitfolge.de/?l=en&s=pseudocron) to give a basic default 'cron' like functionality within Moodle for those whose servers deny them full cron functionality.

Just a thought,

David
In reply to David Lamotte

Re: Automatic emails from forums, how do you set it up?

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Heh, I actually had homebrew pseudo-code like that in the pre-cron version of Moodle, but because it depends on web accesses it's not reliable enough, especially for smaller sites.

I would just like to make a reminder here that the cron facility does not have to be on the same server as your Moodle installation - it can be anywhere in the world, as long as the machine is running 24 hours a day. On the download page is a Windows package I put together, for example, that could be used to run cron on any other computer.
In reply to Martin Dougiamas

Re: Automatic emails from forums, how do you set it up?

by Max Stenlund -
I invented a "poor-mans" cron by using a webbservice called siteprobe (www.siteprobe.com). The service checks the access to your server every hour (one url for free). Pointing the service to the cron.php does the trick. If you can live with only one update per hour its a deal...
In reply to Don Hinkelman

Re: Automatic emails from forums, how do you set it up?

by Martin Meadows -
I know this is an 'old' thread, but the following might be useful for some.

For anyone running Mac OS X (I'm using 10.4 "Tiger"), I have had good results using this command:

*/5 * * * * curl http://your_domain.com/moodle/admin/cron.php

in crontab. It seems to be working fine - as long as my computer is on, of course.