emails from website getting rejected from email services

By wizzle - October 26, 2017

I sifted through the CMSB and plugin files to better understand you... and I can see where sendMessage is used in the forum plugin, in the website membership plugin, and on some core CMSB (like user password request).

I did find one instance of mail() being used in a plugin that I have called emailOnApproved. I don't see the plugin on the official Add-On's page so I think it's a small one that has been passed around the forums a bit.  I am actually using 3 instances of this plugin (renamed). 

So 2 questions...

1. even though the function being called is sendMessage, it is currently still using the built-in php mail() protocol because that's what I have selected in the email settings.  Have other people experienced a similar issue with using that protocol? Is switching to smtp generally a better choice anyways? Or does something just seem screwy with my particular web/email host?

2. Would I be safe in the emailOnApproved plugin to just change the line that says

mail($to,$subject,$message,$headers);

to simply

sendMessage($to,$subject,$message,$headers);

or are the parameters different?

Greg Williams

By Dave - October 26, 2017

Hi Wizzle, 

To answer your questions: 

1. even though the function being called is sendMessage, it is currently still using the built-in php mail() protocol because that's what I have selected in the email settings.  Have other people experienced a similar issue with using that protocol? Is switching to smtp generally a better choice anyways? Or does something just seem screwy with my particular web/email host?

CMSB can send mail a variety of ways, but yes the default still calls mail() (through swift mailer).  mail() is just a PHP function that hands off the message to the outgoing mail server that's running on the server.  It does pretty much the same thing as logging in via SMTP but faster.  

It's likely that switching to SMTP won't change anything, but systematically following the advice of your web host is a good way to rule out issues and get further support.  And if in the end, they don't have a reliable outgoing mail server, you'll still use SMTP but just be specifying another provider.

2. Would I be safe in the emailOnApproved plugin to just change the line that says

The parameters are different.  Most of our internal functions have short instructions or examples in the code above where they're defined.  See if you can find sendMessage (search for: function sendMessage) and figure it out.  If you need help let me know!  Post back and let me know how it goes.

Hope that helps!

Dave Edis - Senior Developer
interactivetools.com

By wizzle - October 31, 2017

You have been fantastic Dave! Thanks for the help so far.

One hurdle that I can't figure out to get my email sending switched over to smtp. My web host has an hourly and daily smtp quota, as I'm sure all of them do.

I see a reference to "background send" in  outgoing mail (under email settings in CMSB), but I can't see how to configure it.

I thought perhaps this could be accomplished with the cron.php that you guys conveniently provided and the "background tasks" menu option, but I didn't see a way to implement delayed or background email sending.

While searching the forums, the only references I found to "background send" where in the newsletter plugin. Do I need to purchase the newsletter plugin to enable this feature? Or do I need to migrate my outgoing emails to a paid smtp service?

I also saw old threads that referenced mandrill (by mailchimp), but it no longer offers a free option.

Greg Williams