Help, I’m not getting emails from the plugin!

For decades, spammers have used badly written contact forms on websites to send spam. They also send email that looks like it is coming from a certain email address without logging in to the email account to do so.

Recently Google tightened up what emails they will allow to come into their user’s inbox. Way back in 2016 Google warned users if an email didn’t have certain security features (DKIM or SPF – more on that later). In Nov 2022 they started blocking emails from new senders without those protections.

That’s actually good news in the war against spam! But it does mean you need to do a bit more setting up of email from your WordPress website. Thankfully Church Admin plugin has some of the tools you need.

In the plugin you can send bulk email (where you are sending the same email to lots of people) in 3 ways

  1. Using the native WordPress mail function
  2. Using WordPress mail function but using the email address SMTP settings
  3. Or using Mailersend which is the best way – tutorial for that. If you are going down the excellent Mailersend route, you can ignore the rest of this tutorial!

Using the Native WordPress Mail Function

This is the simplest way and not very good as WordPress adds a bunch of headers making it obvious it came from a website, which will definitely get blocked by Gmail and Yahoo etc.

Your hosting company may have turned it off too, in order to prevent spammers using badly written code. (My host does! And Church Admin Plugin is not badly written code 😉 )

Check the native function works

In the Communications section of Church Admin you can “Send a test email” to an email address. That will send a test email with your current settings and give you full debug information.

If it works out of the box, that is a good start! But I really don’t recommend using the native WordPress mail function as they won’t get through to Gmail accounts as is. It is far better to send email using an authenticated email account. You do that by adding some SMTP settings (SMTP stands for Simple Mail Transfer Protocol and is how pretty much all email accounts send email – there are two protocols for receiving emai POP and IMAP – but that’s not for this article!)

Adding SMTP settings

My advice is to send email from an account on the same domain as the website (for example an @churchadminplugin email address for this site)

Setup an email on your church website domain and note the SMTP settings (those are the settings you need to send an email with that account.) The main advantage of sending using an authenticated email with the same domain name is that it won’t look like spam!

Once you have the SMTP settings – username, password, port and SMTP server noted, head over to the Communications section of Church Admin and click on “Setup Email”

You need to fill out all the sections and click save at the bottom.

Email settings in Church Admin Plugin

Firstly opt for “Send using SMTP server”

Next setup how quickly emails will go out. Most hosts limit how many emails you can send an hour, to stop spam, typically it is 100. If your church directory has more than 100 people in it, you are going to need to queue email.

Email Queueing

There is two ways to do it. One is using a server setting (cron) and the other uses WordPress’ own scheduling.

The advantage of the server setting is you know that the server will send a batch at the interval you set. But you need to login to your hosting company and get it set up.

The command is

curl –silent https://YOURDOMAIN/wp-admin//admin-ajax.php?action=church_admin_cronemail

You will have the command ready to copy and paste on your site page as you follow this tutorial. I set it to go every 60 mins.

The WordPress method is simpler, but it sends out a batch at the time interval, behind the scenes, after someone next browses the site. On a low traffic site, you have no idea when that will be!

If you can get it setup, the Cron method is best.

Then you set the maximum number of emails you wish to send in a batch every hour.

Now you can add the SMTP settings

Fill out the settings from your email account and finally click “Save”.

Now send a test email again.

If it gets through – fantastic! If not it could be one of three things!

  1. You have got an SMTP setting wrong – the debug information will say SMTP authentication failed.
  2. If it was to Gmail, Yahoo, Outlook email address, it was blocked because DKIM or SPF is not setup (coming to that! Read on)
  3. You were sending it to yourself and your host has a setting that doesn’t allow you to send yourself an email (happened to me. A stupid setting, they took it off when I asked!)
  4. You are on shared host and your host IP is blocked because of spammers using other people’s accounts – you can check that by using https://mxtoolbox.com/blacklists.aspx . Then put a ticket in with your hosting company and ask them to sort it out!

So what about DKIM and SPF? What are they and how can they help.

SPF

Sender Policy Framework (SPF) is used to authenticate the sender of an email. With an SPF record in place, Internet Service Providers can verify that a mail server is authorized to send email for a specific domain. An SPF record is a DNS TXT record containing a list of the IP addresses that are allowed to send email on behalf of your domain.

This is how it works – great article with more information is at https://kinsta.com/knowledgebase/spf-record/

Source DMARC

Get your hosting company to set it up for your domain

DKIM

DKIM stands for DomainKeys Identified Mail and is used for the authentication of an email that’s being sent. It is a record that is add to the DNS (Domain Name Server) of your domain name. It is more complicated to set up than SPF but survives email forwarding so it more useful.

Ask your hosting company to add it for your domain. They should do it as it is in their best interests too!

All of this is a bit of a pain, but it will help ensure any emails sent by your website get through Spam filters and into people’s inboxes.