This plugin has been deprecated! It is no longer being developed and there will not be any continued support for it. Comments to this post are also now closed.
Fear not, for the essence of the plugin continues on in my Configure SMTP plugin.
Since I didn’t want to install and run sendmail merely to support WordPress’s notifications, I opted to have WordPress send directly to the mail server. Fortunately, PHPMailer provides all the functionality I wanted to use (and more). This plugin makes use of PHPMailer (and one slight core code change) to negate the need for sendmail. In addition, by using PHPMailer a host of other mail features could be exploited. For instance, the plugin supports:
- Auto-wordwrap length for message
- Single or multiple SMTP servers
- Hard-coding of all notification origination e-mail addresses (i.e. have all e-mail “From:” fields set to something like “gro.etisymnull@sserpdrow” rather than the e-mail of the commenter)
- Support for authenticating and non-authenticating SMTP servers
- HTML in addition to plaintext ContentTypes for the message body
Special note for upgraders: If you are upgrading from a version of this plugin prior to 1.5 you will have to make note of the settings you had previously set in the wp-phpmailer.php file and re-enter them via the plugin’s new admin options page.
- Unzip/unpack the plugin distribution file wp-phpmailer.zip into your wp-content/plugins/ directory.
[Unless you wish to alternatively install the full PHPMailer yourself, then instead do this:
- Obtain the PHPMailer package from phpmailer.sourceforge.net
- Extract the contents into your wp-content/plugins/ directory (this should create a subdirectory called something like ‘phpmailer-1.72′
- Rename the directory created in (b.) to ‘wp-phpmailer’
NOTE: This plugin was last tested against PHPMailer version 1.72. The plugin distribution file only contains the English-language file for PHPMailer; many other language files are available from the official PHPMailer distribution
- [Skip this step unless you chose to install PHPMailer yourself]
Copy the file wp-phpmailer.php from the plugin distribution file into your wp-content/plugins/wp-phpmailer/ directory
- Activate the plugin from your WordPress admin ‘Plugins’ page.
- In WordPress’s Admin section, click the Options tab. Then click the “wpPHPMailer” subtab. Adjust the configuration options to suit your situation. Be sure to change the very first option, which tells WP to use wpPHPMailer instead of the built-in mailer.
NOTE: If you are using WP 1.5.1 or later, you do not have to do anything else. Just be aware that you cannot have more than one plugin activated that attempts to override the core WP function, wp_mail(). If you activate this plugin and do not see the “wpPHPMailer” tab under “Options” in the Admin section, then you *may* have mail plugin conflicts.
- For those using a version of WP prior to 1.5.1 : In the WordPress core file wp-includes/functions.php, find and replace the single occurrence of “function wp_mail(” with “function old_wp_mail(“
function wp_mail($user, $subject, $message, $headers, $htmlmessage='')
This is a helper function that retrieves the URL of the image for a specified category. Returns ” if no image was found:
- $user : The user sending the e-mail (i.e. firstname.lastname@example.org; “Some Guy” <email@example.com>)
- $subject : The e-mail Subject:
- $message : The e-mail message body, of the ContentType “text/plain” variety
- $headers : (optional) Custom e-mail headers; default is ”
- $htmlmessage : (optional) If defined, then the e-mail will be sent with mixed ContentTypes, a “text/html” part using $htmlmessage and an alternate “text/plain” part using $message.
- WordPress Support Forum announcement of wpPHPMailer.
- 29 July 2005 : v1.6 released (long delayed) — Now takes advantage of the pluggability of wp_mail() in WP 1.5.1+ so that NO core file editing is necessary to utilize this plugin; also, potentially fixed a pathname problem that occurred on Windows servers
- 02 Apr 2005 : v1.5 released —
- Added option page for plugin in WP’s admin section
- Options now stored in the WP database and no longer in the plugin’s file
- Instructions updated to pertain to WordPress v1.5
- License changed from BSD-New to MIT
- 17 Aug 2004 : v1.01 released — Slight fix to header handling so “From:” isn’t duplicated
- 16 Aug 2004 : v1.0 released — Now fully compliant as drop-in replacement for mail():
- $headers argument defaulted to ”
- if $headers is not defined, then no choice but to use hardcoded From: values; if $headers is defined and $use_hardcoded_FROM_values is true, try to set the Reply-To: field to be header From: value (if defined)
- defaults hardcoded e-mail address as the admin’s e-mail address; defaults From: name as “Blog Admin”
- 27 Jul 2004 : v0.93 released — now returns boolean value to indicate success (true) or failure (false) of the mailing; a minor tweak; documentation change at the top of the file to reflect item noted in 13 Jul update. (Thanks, Will!)
- 13 Jul 2004 : Updated documentation to reflect the need to change “mail()” call to “phpmailer()” in wp-login.php for password retrieval.
- 11 Jul 2004 : v0.92 released — slight fix due to the boolean setting
$use_hardcoded_FROM_valuesbeing used with opposite logic. Also left hardcoded From: fields uncommented (they aren’t used unless the aforementioned setting is set ‘true’. (Thanks again, Ricardo!)
- 09 Jul 2004 : v0.91 released — fix so that root@localhost doesn’t appear as the From: field (Thanks, Ricardo!)
- 28 Jun 2004 : v0.9 released to the public
Copyright (c) 2004-2005 by Scott Reilly (aka coffee2code)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.