WP-Members uses the native WP function wp_mail to send all emails. This is a native WordPress function and is generally robust.
Once the plugin generates an email, the wp_mail() function will attempt to send it.
A lot of things can happen after that so just because it was handed off by wp_mail(), that does not equate to being “sent.” Email can be rejected by both the sending server and the receiving server.
If you are on shared hosting, you are likely at the mercy of an email queue with several hundred other accounts also on your shared server. In a shared hosting instance, there is usually no way for you to track an email once it is generated and sent to the queue.
It should also be noted that just because your WP site successfully sends one type of email (such as a new registration or password reset), that does not mean ALL emails will make it through the process. Your sending host (and the receiver) will evaluate every email that goes out to check whether it meets their rules. Therefore, you may find that one type of email goes through fine while other emails are not being sent.
Use an SMTP account
It is recommended that you configure WordPress to send email through an SMTP account. Not only will this solve most email sending issues, it will also give you a more robust process because you will be sending email through an actual account on an email server instead of relying on your webserver. You will be able to track emails and they will have a higher probability of being sent/received. This recommendation is based on my many years as both a WordPress developer as well as running WP sites. (I also spent some time as one of the component maintainers of the Mail Component in WordPress Core, so I am pretty well versed in how wp_mail()
and phpMailer
work.)
In my opinion, the best method to send using an SMTP account is to set up your account details and credentials as part of your wp-config.php file. I have an article on how to do that as well as some example code you can use on Github.
If you cannot do this or are uncomfortable applying this kind of customization, there are a lot of plugins available to run wp_mail()
through your SMTP account. I recommend WP Mail SMTP. It has been around a long time and has a good track record of success. There is a free version and a pro version. The pro version has a “white glove” option available where they will set it up and configure it for you. That’s their “Elite” service, and it is what I recommend. They’ll set it up, test it, and confirm everything is working for you.
Using SMTP will solve most problems, both on the sending and receiving end.
If you can’t use SMTP
If you cannot use SMTP, you will need to understand something about how emails sent via web scripts work. Unless you are running your own hardware, your host will likely require that you be sending email from an actual email address. WordPress will by default send from wordpress@yourdomain.com. It is possible that if this is not an actual address on your account, your host may not allow this.
Even if your host does allow email aliases, the receiver may choose to reject it even before it gets to any spam filter on your specific account.
For best results, send using an actual address. WP-Members has a setting for you to set the “from” address and “from name” in the email settings. Use an actual address using a domain that matches your site domain.
Similar to the above, some hosts and receivers require that an email have proper headers. WordPress does not apply “from” addresses in the email header by default. WP-Members has a filter for the emails that it sends so you can add a “from” address to the header.
Another trick that helps make your email look less like spam and more like a legitimate email is to make sure the “from” address is the same as the “send” address so that the return path is the same as the address the message is coming from.
SPF, DKIM, and DMARC
Sender Policy Framework (SPF) is a type of DNS record that mail admins use to delegate email delivery options through 3rd parties. SPF allows the owner of a domain to set a range of IP addresses and domains that are authorized to send email on behalf of that domain.
There are two reasons SPF is important for your email record when considering your WordPress installation’s email configuration. First, if you’re allowing your web server to send email for you (without setting up SMTP as recommended above), your web server needs to be listed as an authorized sender for email for your domain. Second, if you do use an SMTP account, often this may be a third party (such as Google or Microsoft Live), which would use that third party’s servers, thus requiring an SPF record to note that.
Many receiving email servers will reject email from a domain that does not have an SPF record, especially if the sending IP or server is of a different domain that the email domain.
DomainKeys Identified Mail (DKIM) is a method where a sender (or forwarder) can take responsibility for the content of an email by digitally signing for the message. A receiver using DKIM will be able to reduce inbox delivery of erroneously forwarded or spoofed email received. This greatly reduces the potential for abuse as recipients now have more information on the sender.
Domain-based Message Authentication, Reporting & Conformance (DMARC) is a type of email authentication protocol that leverages the widely used SPF and DKIM protocols to improve a sender’s understanding of how their email in circulation is processed. Email claiming to be from their domain is analyzed by receiving organizations and a digest of acceptance/failures is sent back to the sender. DMARC is used to reduce spam and fraudulent email by giving senders information on what recipients see.
Whether you have these records set or not can be checked using the SuperTool at mxtoolbox.com.
At minimum, you should have SPF set up for your domain record.
Some other links/info
For more information on wp_mail(), how to troubleshoot, and how to set up SMTP, please see this post on my personal blog.
There is a Send Test Emails extension for the plugin which will allow you to send tests of each of the WP-Members plugin’s emails. There is also an email logger plugin for assistance with not only the WP-Members emails, but any other emails being sent from WordPress.