Posts made by Visvanath Ratnaweera

Moodle in English -> General help -> Moodle send mail -> Re: Moodle send mail

by Visvanath Ratnaweera -
iTaba kei {Sa} iTaba kei {Sa}
Interesting. Currently there is a surge of enquiries related to Moodle e-mails (^1). It is also interesting to watch something as simple as plain e-mail can get so complicated.

Anyway, I'll try to put it simple terms:
a. Moodle is an e-mail creator (amoung many other things). You can compare it to the part of Thunderbird where you write e-mails.

b. Similar to Thunderbird Moodle also needs the help of a SMTP server for its outgoing e-mails. You set it in Site administration > Server > Email > Outgoing mail configuration, SMTP.

Now comes the confusing part. Although one talks of "SMTP host" as it being a separate machine, Moodle only needs a _service_, which can handle this job. And that service uses a different port, typically 25 or 587, which are different from the ports Moodle serves, the ports 80 and 437. In other words the "SMTP host" could be the localhost. The condition is that it runs a SMTP service like Exim and Postfix.

Now to the second confusion. If the SMTP hosts (smtphosts) field of Moodle is empty, which is the default, it internally assumes localhost! So people are surprised to find Moodle sending e-mails although "no SMTP server is configured". To make matters worse, there are wrong documentation somewhere and wrong advice given here, saying that there is a SMTP server built in to Moodle!

Long story short,
- Moodle needs a SMTP service, whether running be in the same machine or in a different machine.

- The configuration and maintenance of that service/server is not a part of Moodle. The administrator of that service/server must give the Moodle administrator the particulars he needs to fill the outgoing mail configuration of Moodle.

- If that service happens to run in the localhost, on port 25 and no authentication, the Moodle administrator doesn't have to enter anything, "It just works". (Big problem if it doesn't!)

^1:
- not sending mail - alltough eMailTest says its successful
- Emails Problem with Moodle 3.8
iTaba kei {Sa} iTaba kei {Sa}
No! Unless you tell us exactly where you installed how you installed and how you configured outgoing mail, etc. See the https://docs.moodle.org/en/Installation_FAQ.

Also worth reading the parallel discussion not sending mail - alltough eMailTest says its successful.
iTaba kei {Sa} iTaba kei {Sa}
You see? "Not sending mail" is not the same as "not receiving mail".
:-?

The two cases where Moodle definitely tries to send mail must have narrowed down your search and led to the mainitainers of the mail server.