Log in


  • Category: Communication
  • License: GNU General Public License (GPL) version 2
  • Updated: 2011-2-1
  • Downloads: 13968
  • Recommendations: 32

Other Projects

View Cash's plugins

PHPMailer for Elgg 1.8

SMTP, HTML emails, BCCs and file attachments

by Cash
Last updated 868 days ago


  • SMTP support - including authentication and SSL
  • HTML email
  • File attachments
  • BCCs
  • Additional functionality is easy to add using PHPmailer class

Summary: This plugin has the option to override the default elgg email notification handler and email sending code with 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 http://phpmailer.codeworxtech.com/ 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.

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.

Release Notes:

  • Updated for Elgg 1.8
  • Includes the newest version of PHPMailer

If using Elgg 1.7, use version 0.9.9.


  • Tom 867 days ago

    Thanks, Cash.

    q: We adapted your last version and included email address override filter (for test servers). I know you have seperate plugin for this... but there are so many plugins already and it's just a few lines of code, so we extended this one. Would you be willing to take our changes for this on Github?

    • Override Email address to send ALL emails to (so replaces all to: addresses):
    • But DO NOT override if email address is one of these (between ","):
  • Cash 867 days ago

    Tom, the plan is to move the mail override into the developers plugin that's distributed with Elgg. I think there is a ticket for this in Trac but couldn't locate it right now.

  • Speedysnail6 834 days ago

    What about deyan shell? I used this with deyan shell and I see known difference in the new one as the old one.

  • luiszhou 701 days ago

    Dear Cash, Execute me, would you please update one intruction for gmail account? These plugin seem not in function for elgg 1.8.4. Thank you.

  • rohonupe99 699 days ago

    i'm using .83 and this doesn't work with the gmail smtp

  • thanh 697 days ago

    does not work with elgg 1.8.4.

    Redirect could not be issued due to headers already being sent. Halting execution for security. Search http://docs.elgg.org/ for more information.

  • Mann 680 days ago

    Dear Cash,

    If send mail without checked ssl, it's ok. After check to ssl and try to send, its say that Could not connect to SMTP host.

    I'm using elgg 1.8.5

  • Cash 667 days ago

    @rohonupe99 - I know it works with gmail (please note that using gmail is a production solution!!!!).

    @Mann - maybe a config issue on your side?

  • This Script Lover 395 days ago

    I have fresh setup on Rackspace but emails not sending suposedly because of their relay and they say to use SMTP. I tried this plugin but still not working 100%

    What to use as server/port in the settings? I have localhost and port 25


  • baskin 389 days ago

    The plugin is working as expected. Mails are sent (with gmail smtp) but i have the following issues.

    Message is like that (the content is in greek and it is displayed correctly, the problem is the subject and the first lines)



  • alpik 298 days ago

    @baskin tell me please what i am doing wrong... 

    SMTP Host:smtp.gmail.com


    Password:my password for the email above

    Port Number:465

    but I dont get a validation mail... do I have to do something else? Please help. I'am frustrated :/

  • Ajay 164 days ago


    Even I am facing the same problem as Alpik. Could someone help us out please

  • insanedb 133 days ago

    I get this message

    Redirect could not be issued due to headers already being sent. Halting execution for security. Search http://docs.elgg.org/ for more information.


    SMTP Error: Could not authenticate.


    Do you know what can it be?

  • JogiDarkHeart 64 days ago

    Welcome.. Was the same problem with work on it.. After houer i find right way.


    1st - http://sadeczanie.com.pl/images/plugins.jpg - u must have all options like that !!

    2nd - go to file - mod/phpmailer/vendors/class.phpmailer.php - open in editor

    3rd - use sample from hire using your smtp details - http://sadeczanie.com.pl/images/class_phpmailer.rar

    Have good day ;) !!

  • clu55ter 27 days ago

    Hi @cash I just migrated my 1.8 site to a new host, I've got my php mailer setup with gmail and all notifications were working fine until the migration. Now I receive emails from gmail as follows.

    Someone recently used your password to try to sign in to your Google Account xxxxe@gmail.com. This person was using an application such as an email, client or mobile device.

    We prevented the sign-in attempt in case this was a hijacker trying to access your account. Please review the details of the sign-in attempt:

    I also tried following the link below but still no luck.

    If this was you and you are having trouble accessing your account, complete the troubleshooting steps listed at http://support.google.com/mail?p=client_login

    Do you have any suggestions on why this has started to happen as I was using your plugin as the elgg 1.8 default notification don't work either, now I have no email notifications working on the site at all.


  • clu55ter 27 days ago

    My default emails notifications started working after changing around Line 103 in engin/settings.php from FALSE to TRUE.  $CONFIG->broken_mta = TRUE;

    Sorry if this isn't related to phpmail.