Moodle eMail Test

General plugins (Local) ::: local_mailtest
Maintained by Michael Milette
Moodle eMailTest allows administrators to test Moodle's email system. A trace of the SMTP dialogue will be displayed if the email message cannot be sent for any reason. The eMail Test for Moodle plugin does not store any personal data about any user.
Latest release:
10121 sites
2k downloads
105 fans
Moodle 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 3.10, 3.11

The Moodle eMailTest plugin is a tool that enables administrators to easily test Moodle's mail system. A trace of the SMTP dialogue will be displayed if the email message cannot be sent for any reason.

Once the test email has been sent, you will need to check your email inbox to confirm that the email message was successfully delivered. This plugin will not do that for you.

Potential privacy issues

Note that the email sent to the recipient contains details about the administrator and the site including account username, web browser, IP address, Moodle version and preferred language.

Screenshots

Screenshot #0
Screenshot #1
Screenshot #2
Screenshot #3
Screenshot #4

Contributors

Michael Milette (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Wed, Oct 18, 2017, 4:48 AM
    Hi Mahmood,

    This error message usually appears when you have too many email recipients or there is a limit on how many emails you can send through your mail server.

    Since MailTest only sends messages to a single recipient at a time, it is probably more likely that your mail server provider has either placed a limit on how many emails you can send through it or that you have exceeded the storage quota of your email account or the physical drive.

    This actually happened to me recently. My ISP created a mailbox for my account when I signed up. Each time a cron job would run, it would send an email to that account. Over the years it added up to over 500,000 emails. There were so many emails that they had to clear it from the command line as there was no email client that could handle this many emails. It really surprised me as I was not even aware that the email address even existed.

    As for your situation, the next step would be to contact your service provider and get them involved in troubleshooting the mail server.

    Hope you find this useful. Best regards,

    Michael
  • Sat, Nov 11, 2017, 3:40 PM
    Great news! eMailTest for Moodle has now been tested and approved for use with Moodle 2.5 to 3.4. Other than the testing, there are no changes to the code, only to the documentation.
  • Thu, Dec 7, 2017, 4:50 AM
    Hello,

    I downloaded this plugin to test my moodle emailing functions. I am getting the following message:

    2017-12-06 20:39:13 Connection: opening to smtp.sendgrid.net:587, timeout=300, options=array (
    )
    2017-12-06 20:39:19 Connection: opened
    2017-12-06 20:39:19 SMTP -> get_lines(): $data is ""
    2017-12-06 20:39:19 SMTP -> get_lines(): $str is "220 SG ESMTP service ready at ismtpd0005p1iad1.sendgrid.net
    "
    2017-12-06 20:39:19 SERVER -> CLIENT: 220 SG ESMTP service ready at ismtpd0005p1iad1.sendgrid.net
    2017-12-06 20:39:19 CLIENT -> SERVER: EHLO starslms.com
    2017-12-06 20:39:19 SMTP -> get_lines(): $data is ""
    2017-12-06 20:39:19 SMTP -> get_lines(): $str is "250-smtp.sendgrid.net
    "
    2017-12-06 20:39:19 SMTP -> get_lines(): $data is "250-smtp.sendgrid.net
    "
    2017-12-06 20:39:19 SMTP -> get_lines(): $str is "250-8BITMIME
    "
    2017-12-06 20:39:19 SMTP -> get_lines(): $data is "250-smtp.sendgrid.net
    250-8BITMIME
    "
    2017-12-06 20:39:19 SMTP -> get_lines(): $str is "250-PIPELINING
    "
    2017-12-06 20:39:19 SMTP -> get_lines(): $data is "250-smtp.sendgrid.net
    250-8BITMIME
    250-PIPELINING
    "
    2017-12-06 20:39:19 SMTP -> get_lines(): $str is "250-SIZE 31457280
    "
    2017-12-06 20:39:19 SMTP -> get_lines(): $data is "250-smtp.sendgrid.net
    250-8BITMIME
    250-PIPELINING
    250-SIZE 31457280
    "
    2017-12-06 20:39:19 SMTP -> get_lines(): $str is "250-STARTTLS
    "
    2017-12-06 20:39:19 SMTP -> get_lines(): $data is "250-smtp.sendgrid.net
    250-8BITMIME
    250-PIPELINING
    250-SIZE 31457280
    250-STARTTLS
    "
    2017-12-06 20:39:19 SMTP -> get_lines(): $str is "250-AUTH PLAIN LOGIN
    "
    2017-12-06 20:39:19 SMTP -> get_lines(): $data is "250-smtp.sendgrid.net
    250-8BITMIME
    250-PIPELINING
    250-SIZE 31457280
    250-STARTTLS
    250-AUTH PLAIN LOGIN
    "
    2017-12-06 20:39:19 SMTP -> get_lines(): $str is "250 AUTH=PLAIN LOGIN
    "
    2017-12-06 20:39:19 SERVER -> CLIENT: 250-smtp.sendgrid.net
    250-8BITMIME
    250-PIPELINING
    250-SIZE 31457280
    250-STARTTLS
    250-AUTH PLAIN LOGIN
    250 AUTH=PLAIN LOGIN
    2017-12-06 20:39:19 CLIENT -> SERVER: STARTTLS
    2017-12-06 20:39:19 SMTP -> get_lines(): $data is ""
    2017-12-06 20:39:19 SMTP -> get_lines(): $str is "220 Begin TLS negotiation now
    "
    2017-12-06 20:39:19 SERVER -> CLIENT: 220 Begin TLS negotiation now
    2017-12-06 20:39:19 SMTP Error: Could not connect to SMTP host.
    2017-12-06 20:39:19 CLIENT -> SERVER: QUIT
    2017-12-06 20:39:19 SMTP -> get_lines(): $data is ""
    2017-12-06 20:39:19 SMTP -> get_lines(): $str is ""
    2017-12-06 20:39:19 SERVER -> CLIENT:
    2017-12-06 20:39:19 SMTP ERROR: QUIT command failed:
    2017-12-06 20:39:19 Connection: closed
    2017-12-06 20:39:19 SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting


    I installed a separate version of PHPMailer and set up a test email using the same SMTP settings Moodle is using and I received the email from the standalone PHPMailer. I have DEVELOPER mode turn on for Moodle and it didn't seems to add more messages. Do you have an suggestion as to why the connect seems to fail at the TLS handshake.

    I am using PHP 5.6 / moodle version 3.2

    Thank you,
    Ernie
  • Fri, Dec 8, 2017, 5:27 PM
    Hi Ernie,

    Turning on DEVELOPER mode won't produce any additional information because that is exactly what the plugin does in order to capture and display this information.

    As for your error message, did you take a look at the link it suggested on the last line? https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

    Search the page for "SMTP Error: Could not connect to SMTP host." and anything to do with "TLS". Also note the section that specifically mentions "PHP 5.6".

    TLS stands for "Transfer Layer Security" which is all about secure encrypted email communication. I am not familiar with your email environment but your problem could be with openssl, DNS, port, credentials, server configuration, etc. If your successful test was on the same server as your instance of Moodle, that could eliminate many of these possibilities. What remains is potential conflicting configuration issues, on the web server and/or the mail server.

    When you tried using a standalone instance of PHPMailer, you are very likely using different configuration settings as well. The next step would be to compare the configuration between the two instances of PHPMailer. Comparing their interaction with the SMTP server might reveal something of significance.

    Have you tried conducting your test using the version of PHPMailer that is included in Moodle's /lib/phpmailer folder? Have you tried sending email using PHP's own mail() function?

    Hope this gives you some ideas of things to try.

    Best regards,

    Michael
  • Fri, Dec 8, 2017, 5:33 PM
    Ernie, don't forget to make sure that you are using a valid (real) no-reply email address. I've seen a problem similar to this and switching the no-reply email address to a real one did the trick.
  • Fri, Dec 8, 2017, 9:25 PM
    @Ernie, I would like to suggest testing the moodle with a gmail account. Usually institutes have different rules and staffs, so it may be hard to find the bottle neck. However, Gmail is freely available and you can enter the imap and smtp and ports. If the Gmail test was successful, that means everything is ok with you moodle. Then you have to consult with your admin.
  • Sat, Feb 2, 2019, 2:13 PM
    So simple but so needed, thank you
  • Mon, Mar 23, 2020, 1:24 AM
    Hello. I have a problem with my project and I can't solve them.
    this is the error:

    Connection: opening to outlook.office365.com:993, timeout=300, options=array()
    2020-03-22 15:28:41 Connection failed. Error #2: stream_socket_client(): unable to connect to outlook.office365.com:993 (Permission denied) [/var/www/html/lib/phpmailer/src/SMTP.php line 324]
    2020-03-22 15:28:41 SMTP ERROR: Failed to connect to server: Permission denied (13)
    2020-03-22 15:28:41 SMTP connect() failed.

    I searched in the internet but any resolution resolve



  • Mon, Mar 23, 2020, 1:05 PM
    Hi Samir,

    Moodle sends email over SMTP (port 587), not IMAP (port 993) so you can't just copy the settings from your smartphone.

    For the proper settings, see
    https://support.office.com/en-us/article/pop-and-imap-email-settings-for-outlook-8361e398-8af4-4e97-b147-6c6c4ac95353

    Some additional tips (predicting your challenges):
    - Sometimes you may need to also specify the port on host address.
    Example: outlook.office365.com:587
    - Be sure that your no-reply email address is one that actually exists.
    - Use TLS.

    Hope this helps.

    Best regards,

    Michael
  • Ricardo Caiado
    Tue, Aug 18, 2020, 4:43 AM
    Is it compatible with 3.9+ version of Moodle?
  • Thu, Sep 24, 2020, 7:40 PM
    got the following success message while sending php sendmail , but mail not recieved

    Logging is not available when using PHP mail() function. However, may find logs on your server. Most common locations on Linux include:

    /var/log/maillog
    /var/log/mail.log
    /var/adm/maillog
    /var/adm/syslog/mail.log
    Alernatively, a custom location may be specified using the mail.log setting in php.ini.

    Success
    The Moodle test message was successfully accepted by PHP Mail.

    From : admin@xxxxxxxxxx.ca
    To : xxxxxxxx@gmail.com


    plz guide anyone . using moodle latest 3.9

  • Tue, Jul 20, 2021, 2:08 PM
    Hope someone can help, Is it compatible with 3.9+ version of Moodle?

    Regards,
    www.elpasotileinstallation.com
  • Wed, Jul 21, 2021, 1:07 AM
    Ricardo and Madison - As indicated at the top of this plugin's page, it is compatible with Moodle 2.5 to 3.11.
  • Wed, Jul 21, 2021, 1:12 AM
    Rrinivas a - You either need need to set-up the SMTP settings in Moodle or in your server. For more help, please use the Discussion link on the plugin page and post any further questions you might have in the discussion forum.
  • Thu, Jul 29, 2021, 7:03 AM
    I'm using Moodle 3.11. Thanks for the guide, Michael!

    Joana
    www.portlandexcavationpros.com/
1 2
Please login to post comments