Release Notes

Changes from previous version:

  • fixed From name bug
  • added smtp authentication toggle to settings

Next version: will work on handling html markup from TinyMCE in plain text emails.


  • SMTP support
  • HTML email
  • File attachments
  • BCCs
  • Additional functionality is easy to add using PHPmailer class

Summary: This plugin overrides the default elgg email notification handler and uses PHPMailer. It currently provides support for using the php mail function or a smtp server. See the included readme.txt for more information.

Description: This plugin provides a wrapper to the PHPMailer class. PHPMailer is used by many open source projects including Wordpress and Joomla. The class provides the abaility to send mail through php's mail function, sendmail, qmail, and smtp. It supports html email, file attachments, and embedding images. See for more details. This plugin provides a simple wrapper around the PHPMailer class.

Installation: Unzip and place in mod directory. Activate through Tools Administration. There are admin settings for smtp and non-standard MTAs. There are further instructions in the readme.txt file.

SMTP: SMTP can be setup in the admin settings of the plugin.

Notes: Other plugins may have their own email sending code and will not use this plugin therefore. The Invite Friends plugin is an example of one. I've added an interface that allows other plugins to send through this plugin (skipping the elgg notify system). This allows someone to write an Invite Friends plugin to check if the phpmailer plugin is installed and send through it if it is. It also makes it easy to build plugins to send email to people outside the social network (example: adding a "share this" link to content that allows users to send emails to friends)

Bug Reports: Please post them in the comments along with any related error message in your server error log. If you did not read the readme file or check your error log, I am much less likely to spend time giving you support.

  • Also, Cash, you say you've "added an interface that allows other plugins to send through this plugin" ... as an admin is that an interface I can see in the browser on the site ? or is it something else ?

    Finally, in the readme file

    See the function phpmailer_send() in mail.php.

    Can someone point me in the direction of how to set that up ?

    Thanks again.

  • @jbvk - I edited the language to make it more clear. Basically, it is possible for someone to write a Invite Friends type of plugin now that calls the PHPMailer. No one has done that, but it would be almost trivial to do.

    If another plugin wants to use PHPMailer, it just needs to check that the the function phpmailer_send() exists and then use it.

    There is no way to do this without writing code. To do this, find where in the plugin it is calling the mail() function and replace that with a call to phpmailer_send(). The parameters are different but should be easy to figure out.

  • thanks so much, Cash.

  • I hope if anyone actually does this they will post instructions....

  • seconded, jededitor. This is beyond my ability. Simple instructions would be fantastic.

  • @Cash: The problem was with my previous webhosting provider.
    Now works fine.
    Thanks a lot.

  • Cash - have you considered releasing versions of mods that do use the php mail function?

  • @jededitor - do you mean plugins that use PHPMailer?

  • PHP mail call is

    PHP Mailer call is

    • phpmailer_send ( "",  "FromName", "", "ToName",  "Subject" , "Message Text..." ,  array $bcc = NULL, $html = false, array $files = NULL, array $params = NULL ) ;

    The PhpMailer part " array $bcc... etc" for most ouf the simplter uses are probabaly not really needed.

    So if anyone wants to fix up their other PlugIns to call PhpMailer, I hope this suffices as a guide to the code patches. It should not be too hard to code...

  • @cash

    Oops yes! I did mean plugins <blush>

  • I'm trying to convince the core developers to add a function for sending mail to nonmembers without much luck. If that did happen, PHPMailer could just override that function and plugins like the Invitations plugin would integrate well. I really don't have any interest in maintaining a separate set of plugins that need to send emails to nonmembers.

  • I can understand that as it will take up a lot of time - never mind though I'm sure some people will post the relevent instructions for chanmging this in various plugins... people?

  • It is not difficult. My plugin provides a single convenience function phpmailer_send. As pointed out, you just have to find where the plugin is calling mail() directly and replace it with phpmailer_send(). The arguments are different obviously, but should be easy to figure out.

  • Good! Then I'm sure that someone with a lot of time on their hands will find this out for each plugin and let us have a list ;-)

  • Hi cash.

    I downloaded and installed your PHPmailer plugin and it works perfect for registered users, but for nonregistered users this doesn't works.

    You says that anyone can " just have to find where the plugin is calling mail() directly and replace it with phpmailer_send()", but this function doesn't exists in any package! It's maybe in a previous versión and not included on the last versión?


  • Sorry me. I downloaded a previous version thinking it was the latest one. I replaced it and it worked everything fine now.

    Thanks a lot.


  • Category: Communication
  • License: GNU General Public License (GPL) version 2
  • Updated: 2014-11-17
  • Downloads: 17050
  • Recommendations: 34

Other Projects

View Cash's plugins