Email Users v4.5.3-beta-4 now available

This morning I pushed out beta-4 for Email Users v.4.5.3.  This latest update addresses the duplicate header information discovered by Andy Fragen.  I had already fixed the problem with the TO header Andy noted but was unaware of the duplicate MIME-Version header.  It turns out, there was also a duplicate X-Mailer header as well.

By default wp_mail() sits on top of PHPMailer.  WordPress does not check for either the MIME-Version header nor the X-Mailer header.  Unless specifically set, PHPMailer will add its default values for these two headers which is what was happening.  It appears that some systems are sensitive to duplicate headers and reject the messages and others do not.  This definitely explains why it is difficult to reproduce reports that come in of users not receiving email.

Because wp_mail() is pluggable, other mail implementations may be expecting these headers to continue to exist.  What I have done is added two new options to add the headers as Email Users has been doing all along.  By default these two options are off because PHPMailer duplicates them and I expect most people use the default WordPress implementation.

EU_SS_23

I also improved the information panel I added recently to report the existance of any filters which may interact with Email Users.  For the most part these filters don’t do any harm however they can change override the FROM information in the email or the format which may be unexpected. The new information in the panel is nothing more than a note that something else may be affecting your email outside of Email Users (e.g. why is my From name different than what I set?).

EU_SS_22

Please report any issues with this latest beta update.

Email Users Beta (4988 downloads )

Email Users v4.5.3-beta-3 now available

This afternoon I posted the third beta release of Email Users v4.5.3.  There is a pretty significant change in this build so I may bump to v4.6 when I release it.

Yesterday I posted an article about an odd Email Users problem I was looking at.  This build fixes (correctly) the problem encountered by that user by properly using get_users() instead of a complex SQL query to retrieve the information used to construct the User Settings page.

In addition to being properly constructed, the User Settings page has a number of fixes including proper sorting and the addition of Search (which I could never get working using the old query).

I’ve also addressed a couple of other very minor requests that came up recently in the WordPress Support Forum.

Email Users Beta (4988 downloads )

Email Users v4.5.3-beta-1 now available

I’ve been looking at a problem reported on the WordPress Support Forum.  While I can’t replicate the problem, I have found some things in the code which constructs the email headers which needed some attention.

This beta build has refactored the construction of the email headers as well as a couple recently requested minor enhancements (%POST_CONTENT% keyword, CC Sender).

Email Users Beta (4988 downloads )

Email-Users Debugging – why don’t my users receive email?

Periodically users post questions in the Email-Users support forum wondering why their users don’t receive email messages when they expect them to.  There are many reasons why users don’t receive email, some are within the control of Email-Users but many are not.

Email-Users User Settings

Email-Users is based on two user settings (which appear on the user’s profile page):

  1. Receive post or page notification emails
  2. Receive emails sent to multiple recipients

EU_SS_14Email-Users has a plugin level setting which allows end users to modify their own settings which is enabled by default.  When it is disabled, only users with the proper permissions can modify user settings related to Email-Users.  No matter how the user has their settings configured, a user can always receive an email when they are the only recipient.

EU_SS_15In Email-Users v4.5.2 a new Dashboard Widget has been added which reports the number of users who have their settings configured to receive each type of email.  This information also appears on the Plugin Settings Page and should either of the types of email not have any users set to receive email, a warning message is displayed at the top of the screen.

EU_SS_17Changing the Email-Users settings for a large number of users can be accomplished from the User Setting menu.  By selecting the desired Users, Notifications and Mass Email can be enabled or disabled for a large number of users at one time.  For a site that has a large number of users, the number of users which appear on each page can be changed on the Settings Page.

Test Email

Before sending out notifications or messages, it is important to validate the underlying WordPress email system is working.  On the Plugin Settings page there is the ability to send a Test Message.

EU_SS_18

Email-Users utilizes WordPress’ wp_mail() function to send email.  It does not interact with the OS or PHP mail functions directly.  By using wp_mail(), which can be overridden by other WordPress plugins, Email-Users can work with different server configurations and email infrastructure.

If you don’t receive the test message then you may have a problem with your underlying WordPress email system.  Do you receive email for user registration and comments?  If not, there is something wrong which is out of the scope of Email-Users.

On some servers plugins such as WP-Mail-SMTP (this is just an example, there are others) can be used in situations where email is being sent but isn’t being received.

There is no point in trying to send Notifications or Mass Emails if the Test Message isn’t working.

BCC Limits

Some servers limit the number of email addresses which can appear in the BCC header of an email message.  Email-Users has a setting to control the number of addresses which appear in the BCC field.  If Email-Users is working for a small number of users but isn’t working for a larger number (e.g. all of your users) , you may be dealing with a BCC limit.

If you are able to send email to 3-5 users by selecting them from the list of users, I would next try sending a message to about 10 users and see if that works.

The sending logic is only different when 1 user is selected. Anytime more than one user is selected (2, 10, 37, 67, 1000, etc.), the same logic path through the code is used.

The only thing that is different is how many emails are sent and that is based on the BCC limit setting. If there is no limit, which is the default, it sends one email with all recipients on the BCC line. For any other setting, it will send some number of emails, depending on the BCC limit. If the BCC limit was set to 30 and you had 67 recipients, it would send 3 emails: The first 30, the second 30, and the final 7.

Advanced Debugging

In some situations you may want to examine what Email-Users is doing in gory detail.  For development purposes Email-Users has a DEBUG mode.  When in debug mode Email-Users will log quite a bit of information to the PHP error console using error_log() including the actual email headers it generates.  It can be very useful to see the actual mail headers to ensure the expected recipients are actually included.

Because gaining access to the contents of the error_log() differs from web host to web host, I recommend using a WordPress debugging capability to capture it in the site’s /wp-content folder.  By setting WP_DEBUG_LOG to true in your wp-config.php file, you can easily access the resulting debug.log file.  On my development machine I use the following set up in my wp-config.php file:

define('WP_DEBUG', true); // or false
if (WP_DEBUG) {
 define('WP_DEBUG_LOG', true);
 ini_set('display_errors', 'on');
 error_reporting(E_STRICT | E_ALL);
 define('SAVEQUERIES', true);
 define('SCRIPT_DEBUG', true);
 error_log('Debug On!') ;
}

You would not want this on a production server but to temporarily chase down a problem, it works well.  Unfortunately some plugins issue a lot of notices or warnings so you can run into the “Headers already sent” problem so you may want to tweak the above settings to meet your needs.

Once your WordPress debugging settings are tuned to your liking, you need to enable Debug for Email-Users.  Doing this requires manually editing one of the plugin files.

On or about line 46 of the email-users.php file you will find a line of code which reads:

define( ‘MAILUSERS_DEBUG’, false);

You need to change the code such that it reads:

define( ‘MAILUSERS_DEBUG’, true);

After you have made this change Email-Users will output information to the error_log.

In the image below you can see a series of email headers each with 10 email addresses in the BCC field (BCC limit is set to 10).

EU_SS_19

If the information in the error_log is what is expected then there is little, if anything which can be done from Email-Users.  At this point you will need to figure out where the email is routing to and where it isn’t which is beyond the scope of the Email-Users plugin.

Anecdote

I was using Email-Users on our local Swim Team’s web site and heard from a number of parents that they weren’t receiving emails.  I noticed that all of the reports were coming from families with RoadRunner email addresses.  It turned out that Time Warner had blacklisted our Swim Team’s domain.  By filling out a form with TWC and verifying some information, we were able to get white listed but for several weeks I wasn’t sure how to resolve it.

Email-Users 4.5.2 released

This morning (updated) afternoon I released a minor update, v4.5.2 (updated) v4.5.3, of Email-Users.  This update adds new information on the Dashboard to help the WordPress Admin ensure that the number of users they expect to receive email is correct.

There is a new Dashboard Widget and an updated Settings Page which note how many users will receive each type of email.  If no users will receive notifications or mass emails, a warning message will be displayed at the top of the Settings Page.

Email Users Settings Page

In addition to the new Dashboard Widget for Email Users, I am adding some additional information to the Settings Page to indicate when User Setttings aren’t in a state the admin expects them to be.

When visiting the Settings Page, if either the number of users who receive post or page notifications OR mass email is equal to zero, a message will appear at the top of the page.

EU_SS_15

 

In addition to the box pictured above, the current number of users who receive each type of email is now displayed in a small box at the top of the right hand column above the Donation box.

EU_SS_16

 

Hopefully these improvements will help people chase down situations when users aren’t receiving email when they are expected to.

Email Users Dashboard Widget

I’ve gotten a rash of questions about Email Users lately.  Most of the questions revolve around users not receiving email messages.  In some cases the users don’t receive email messages because their settings aren’t set correctly.  I am in the process of adding some information to Email Users to make it obvious when this is the case.  The first thing I am working on is a Dashboard Widget.

EU_SS_13

 

EU_SS_14

Should anything else appear on this widget?

Email Users v4.5.1 released

This evening I released a minor update to Email Users. This update, v4.5.1 addresses two feature requests (Post Author Keyword Replacement and Post Excerpt Filtering, removes some debug code, and adds Italian language support.

You can find the update in the WordPress Plugin Repository or on your Dashboard as an update.