Where Can I find incoming emails when use email_to_user()

Where Can I find incoming emails when use email_to_user()

by sarah aldossari -
Number of replies: 3

I created new block in moodle that will send an email using 

email_to_user() if the form is submitted. I enabled the debugging mode and there is no error, but I did not receive any notification in the message menu. Where Can I find the incoming emails?

Or how Can I make it submit the email so that it will appear in the "Message Menu Icon" that is next to the username.

Regards,
Average of ratings: -
In reply to sarah aldossari

Re: Where Can I find incoming emails when use email_to_user()

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
For e-mail the debugging is a bit different because it communicates with an external system. The Moodle eMail Test plug-in is a possibility. Another is to check the logs of the SMTP server Moodle is delivering mail to, if you have the access to it. Very easy, if you run a local SMTP server, like Exim or Postfix. That is the Moodle default - all SMTP parameters empty.
In reply to sarah aldossari

Re: Where Can I find incoming emails when use email_to_user()

by Dominique Palumbo -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hi,

Did you receive the email at least ?

This api only send email, I think.
I'll look what it need to create a notification.

Dominique.
In reply to sarah aldossari

Re: Where Can I find incoming emails when use email_to_user()

by Neill Magill -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
For development I recommend that you have your Moodle pointed at a mail catching service on your system (for example mailcatcher on Linux) so that you can see that Moodle sends something and don't need to wait on it getting to your mail account and through any spam filtering.

To get things to show up in the message menu you will want to use the Message API: https://docs.moodle.org/dev/Message_API i.e. message_send() rather than email_to_user()
Average of ratings: Useful (1)