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).
- Log into Moodle as a site administrator
- Navigate to Home > Site Administration > Development > Debugging
- Set Debugging Messages to DEVELOPER: extra Moodle debug messages for developers
- Add a checkmark to the Set Debug Email Sending
- 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.