What does moodle need in order to send mails?

What does moodle need in order to send mails?

by Christophe Leville -
Number of replies: 5
Hi!
I do not understand how works the mail function in PHP. In the configuration I didn't put any arguments for the mail options. th documentationsays that when it is left blank, moodle uses the PHP mail function. But how does it work exactly? I have problem sending mails (I get the message: Tried to send you an email but failed! ). In the documentaion of moodles regarding requierments and the installation, there isn't a word about a mail server. Still it seems that moodle needs a mail server, doesn't it? That's why I would like to know exactly how the PHP Mail function works, in order to know what I need to do.

christophe
Average of ratings: -
In reply to Christophe Leville

Re: What does moodle need in order to send mails?

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Moodle, in the absence of any 'SMTP parameters' tries to deliver mail to port 25 of the 'localhost', i.e. the Moodle server itself.

For this to work, a SMTP daemon must be running on the machine, which listen to that port.

Any standard Linux distribution will have such a program.

If you are on Windows, read this: http://moodle.org/mod/forum/discuss.php?d=52776
In reply to Visvanath Ratnaweera

Re: What does moodle need in order to send mails?

by Christophe Leville -
thanks for replying.
My server is a linux machine.
I still do not understand why it doesn't work on my server. I had a look at the mail function in the php.ini: it calls sendmail. When I look in the log files, then there are some error messages. That's why I don't get it how moodle work regarding mails: if it does not need a mail server, why does the PHP mail function call sendmail?!

christophe
In reply to Christophe Leville

Re: What does moodle need in order to send mails?

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
That "some error message" might open the next door (Lewis Carrol)
In reply to Visvanath Ratnaweera

Re: What does moodle need in order to send mails?

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Mmmm..... is that true? I was under the impression that it simply called the "sendmail" program (or whatever aliases itself as such) to handle the mail in the absence of a smtp setting.

Windows of course has no such thing. You have to specify a smtp server. If you don't have one then you have some work to do. Setting up a mail server is a much bigger pain in the rear than setting up Moodle tongueout
In reply to Christophe Leville

Re: What does moodle need in order to send mails?

by Erik Ringmar -
Dear Christophe,

That's a very good question. Why isn't there any information on how the php.ini file needs to be set up? I've failed to set up the SMTP server and the default PHP option isn't working. What would make it work I wonder ...

yours,

Lin