General plugins (Local): Moodle Mail Test for Testing Site Email

General plugins (Local): Moodle Mail Test for Testing Site Email

by Michael Milette -
Number of replies: 15
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Moodle Community!

TNG Consulting Inc. has just release the first version of a plug-in called Mail Test, developed by Michael Milette (that's me!), which enables Moodle administrators to easily test their Moodle site's SMTP configuration and ensure that emails are being delivered correctly.

Both developers and system administrators will find this plugin valuable when setting up a new instance of Moodle or for troubleshooting issues with existing installations.

You can get the Mail Test plugin here: https://moodle.org/plugins/view/local_mailtest

The Mail Test plugin page includes information on how to install this useful but simple tool, how to use it as well as screenshots of what you should expect to seeThere is also a Bug Tracker item set up for feature requests and bug reports.

Feel free to post questions and suggestions below.

Best regards,

Michael Milette

Average of ratings: -
In reply to Michael Milette

Re: General plugins (Local): Moodle Mail Test for Testing Site Email

by Michael Milette -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Moodle Community!

Just in time for the long awaited Moodle 3.1 LTS, TNG Consulting Inc. has just release the second version of Mail Test which enables Moodle administrators to easily test their Moodle site's SMTP configuration and ensure that emails are being delivered correctly. Both developers and system administrators will find this plugin valuable when setting up a new instance of Moodle or for troubleshooting issues with existing installations.

You can get the latest version of the MailTest plugin here: https://moodle.org/plugins/view/local_mailtest

New in this release:

  • French Translation in AMOS - Update your French language packs!
  • Displays whether the test is using the PHP mail() function or talking directly to the SMTP server.
  • Option to choose whether test email will be sent from your email address, the noreply user email address, or the support email address.
  • Moodle MailTest is now compatible with Moodle 2.5 to 3.1 LTS.
  • README.md now contains answers to common questions (FAQ).
  • Added CHANGELOG.md file.
  • Added link to plugin's discussion forum in the plugin's Moodle.org Plugins directory.

Feel free to post questions and suggestions.

Best regards,

Michael Milette

In reply to Michael Milette

Re: General plugins (Local): Moodle Mail Test for Testing Site Email

by marwa bekrar -

Hello Michael Milette,

I installed your plugin on my moodle platform successfully : 



But when I test, I get this error: 



Here is my Email settings: 


I kept everything in default settings. What is wrong in my settings ? 


Thank you. 


 

In reply to marwa bekrar

Re: General plugins (Local): Moodle Mail Test for Testing Site Email

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Do you have a php mailer installed on your server?

Average of ratings: Useful (1)
In reply to Emma Richardson

Re: General plugins (Local): Moodle Mail Test for Testing Site Email

by marwa bekrar -

Hello Emma,

I installed it with this command : sudo apt-get install libphp-phpmailer

If there is another procedure to follow, please show it to me . 

I use PHP 7.0.8 on ubuntu server 16.04

Thanks. 



In reply to marwa bekrar

Re: General plugins (Local): Moodle Mail Test for Testing Site Email

by marwa bekrar -

I am sorry, the problem was in php sendmail.


I succeeded this time, thanks Emma 



In reply to marwa bekrar

Re: General plugins (Local): Moodle Mail Test for Testing Site Email

by Michael Milette -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Marwa,

Although you've already resolved your issue, I will expand a little on what appears to have happened.

The fact that the SMTP hosts field is empty in your screenshot tells me that Moodle is trying to use SendMail. The reason there is no additional information is due to the fact that it Moodle could not establish any communication at all with a mail server.

In order to make Moodle work, you always have to either configure your settings in Moodle or in SendMail (or something similar). As you discovered, in your case the problem was with the SendMail configuration.

The latest version of eMailTest, released on November 27th 2016 on Moodle.org, actually provides additional information for this exact situation. You must have installed the old version just before I made the new one available.

Glad to hear that everything is working for you.

Best regards,

         Michael

Average of ratings: Useful (1)
In reply to Michael Milette

Re: General plugins (Local): Moodle Mail Test for Testing Site Email

by marwa bekrar -

Yes, that's true. I installed it before 27th November 2016. 

Thank you MICHAEL smile

In reply to Michael Milette

Re: General plugins (Local): Moodle Mail Test for Testing Site Email

by Michael Milette -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Quick Tip

Moodle requires that you configure either Moodle, or your server with the SMTP configuration information for sending email. If you don't have this, contact your server administrator, your Internet Service Provider or your email service provider. They should be able to provide you with the information you need:

  • SMTP Server address
  • Port number
  • Authentication type
  • User name and password
  • The SMTP security encryption

In fact, if you give them a screnshot of the Moodle SMTP configuration screen, they should be able to provide you with the information you need.

Keep in mind that not all of the information is required. For example, if the person who setup your web server already configured this information into PHPMailer, most of the defaults would be just fine as long as the mail server and your site are both on the same web server.

The mail server may also require a noreply email address that actually exists.

Reminder: Always be sure to upgrade to the latest STABLE release of the Moodle Mail Test plugin from Moodle.org as it provides better diagnostic and more helpful information.

Let me know if you have any questions.

Best regards,

Michael Milette

In reply to Michael Milette

Re: General plugins (Local): Moodle Mail Test for Testing Site Email

by Michael Milette -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

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.

Best regards,

Michael MIlette

Average of ratings: Useful (1)
In reply to Michael Milette

Re: General plugins (Local): Moodle Mail Test for Testing Site Email

by Wilfrid Ntonga -

Dear Michael,

Thank you for your plugin which really works fine.

I have tested it and it says everything is fine (success). But still, Notifications are not received (no email received). Is this normal ?


Best,

wilfrid

In reply to Wilfrid Ntonga

Re: General plugins (Local): Moodle Mail Test for Testing Site Email

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Do you get the test email that the plugin sends?  Do you have cron running on the site?  Notifications turned on?

In reply to Emma Richardson

Re: General plugins (Local): Moodle Mail Test for Testing Site Email

by Wilfrid Ntonga -

thanks Emma.

No, I did not get any message.

How can I check if I have cron running on the site ?

Yes, notifications is turned on.


Best, Wilfrid

In reply to Wilfrid Ntonga

Re: General plugins (Local): Moodle Mail Test for Testing Site Email

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

When you run the test message, check the box to show the output even if successful.  If it is truly talking to your mail server and sending the mail, then your email client is blocking it somehow.

Cron is vital to Moodle - you need to check with your host or your server admin.  There are instructions on setting it up in the documentation.

In reply to Michael Milette

How to do Batch Email Testing ? (Urgent !!!)

by Amrata Ramchandani -
Hi,


Single Email recipient works fine always.

I want to know if some how if it is possible to check if we can do testing for batch of email ID's. We are facing problem in batch.Our emails are being delayed and missed out many a times.

For Example,out of 20 ppl to whom I mailed yesterday,only 18 ppl got email and rest didn't receive any.

So would like to know if there is any email queue maintained by the Moodle or SMTP server.


Regards,

Amrata

In reply to Amrata Ramchandani

Re: How to do Batch Email Testing ? (Urgent !!!)

by Michael Milette -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Amrata,

Unfortunately the Mail Test tool does not support sending multiple emails and probably never will. If it did, it could potentially be used to send out mass spam emails.

Moodle sometimes does queue emails which are then delivered when the maintenance script is run by cron. You can check if cron is running by going to the Site Administration > Notification page. If you don't see anything about cron not having run in the last 24 hours, it is running.

As for your SMTP server, I can't comment on that because I have no idea on your system configuration.

Some potential reasons might include:

  • The recipients did receive the email but it ended up in their Junk/Spam folder. Some email services won't even deliver junk emails to your email client and are only accessible through their web interface.
  • The recipients email box is full and cannot receive anymore emails.
  • You are sending bulk email messages with too many recipients. Some SMTP server will impose a limit on how many recipients it will deliver to. Try shuffling the recipients list. If it always stops at 18, you'll know that is the problem.
  • Your server has been black listed by some mail servers. In this case, emails won't be delivered at all to that person. You can tell this by just sending one individual email to that person. If it doesn't make it, this may be the problem. This is one of the top reasons to make sure your web server and your SMTP server are on separate servers. Once your server has been blacklisted, it is a lot of work to get it un-blacklisted.
  • Make sure that your no-reply email address is a real email address and that Moodle is configured to use it. If emails can't be delivered, very often you will find that the mail server that tried to deliver the email sent an email back if it could not, and it may even tell you why. Also, if you are trying to send out emails from a user instead of the no-reply address, some mail servers will identify this as trying to relay email and block it depending on the domain.

Assuming your desktop email client is using the same SMTP server as your Moodle server (if not, why not?), try sending an email to the same 20 recipients from your desktop and see if all 20 emails make it through. If only 18 make it through, your problem has nothing to do with Moodle.

The MailTest for Moodle plugin is really just a convenience tool. All it does really is check some Moodle settings, provide you with links to a set of relevant configuration pages and make use of Moodle's own email and debugging feature to send emails and display the dialogue between Moodle and the SMTP server.

If you want to see similar log results for your bulk mailing, you will need to enable the relevant debugging features in Moodle. Here's how:

WARNING: Changing these setting will enable debugging for all Moodle users, not just for you as a Moodle Administrator. Be as brief as possible during a time when there are no other users logged into Moodle. Even better, do it in a copy of your Moodle site (sometimes called a Sandbox).

  1. Log into Moodle as a site administrator
  2. Navigate to Home > Site Administration > Development > Debugging
  3. Set Debugging Messages to DEVELOPER: extra Moodle debug messages for developers 
  4. Add a checkmark to the Set Debug Email Sending 
  5. Click the Save Changes button.

Next, perform your test. A log of the dialogue between Moodle and your SMTP server will be displayed.

IMPORTANT: Be sure to undo these changes as soon as you are finished your test.

I suspect that the problem is between your SMTP server and other mail servers so you may not see any problems here.

Some SMTP server include an option to enable logging. If available and enabled, this might show you the dialogue between your SMTP server and the next server to which the email is being delivered (which may not be it's final destination). This could offer you a clue. Consult your SMTP server documentation to learn more about this.

Other possibilities could be related to SMTP server, DNS MX record, SSL certificate not being configured correctly to name a few. There are so many reasons that emails might not get through. Trace the email through the delivery process and figure out where it gets blocked. If you suspect it is being blocked at the recipients email server, you may need to work with their provider's tech support to figure it out.

By the way, the problem wouldn't be with delivering messages to @yahoo email addresses, would it? If it is to a specific domain, try googling something like the name of the service provider and the words Rejecting SMTP Email.

Hope you find something useful in all of this.

Best regards,

Michael Milette

Average of ratings: Useful (1)