• This mod no longer works with elgg 1.6.1 :(


  • I know of no reason why it shouldn't work. I'll confirm later today.

  • In my testing it works fine on 1.6.1

  • I know this is not a question that should be posted here (trust me, I've posted it elsewhere as well, including the forums where it should go), but does anybody know why emails don't go out using the invitations plugin? 

    When you send an invitation, the system says that the emails were sent out, but the people who were invited never receive an email. Since this plugin is related, I was wondering that someone here might have an answer.

    Much appreciated if someone can explain how to fix this!

  • Invitations plugin uses its own sending code. Compare its sending code to what is in engine/lib/notifications.php

  • Hi! I really confused with sending mail over elgg.
    I did:
    - created a gmail address - pop enabled
    - copied the phpmailer folder to x:\AppServ\www\elgg\html\mod\phpmailer
    - enabled the plugin configured the settings (smtp, user pwd)
    Send email to friend -> no success

    Whats wrong?

  • @ShonoSF - gmail uses different settings than typical smtp. Do a search on gmail and phpmailer and you should find some instructions on how to modify the code to make them compatible.

  • HI Cash,

    Im sure this is a great plugin looking at the positive comments.  I am trying this myself but I can not get this to replace the default email_notify_handler which I assume replaces.

    For engine/lib/notifications.php

    Can you help?  I am still getting text emails.  Im testing this on windows if that makes any difference?




  • It's for the groups notifications.  It uses notify_user, i guess this won't work?

  • colinliu - notify_user goes through the standard notification system and will call phpmailer if enabled. You should be able to check the email header and see if it says the sender is phpmailer.

  • I noticed where it went wrong.  html should have been set to "true" in the phpmailer_send!!!

    Think this should be added for new users?

    Thx Cash


  • phpmailer supports html email but not by default. I haven't heard from many saying they were using it for that. I'll update the documentation to make that more clear.

  • I get a problem with 1.6.1 and gmail! I definded 'smtp.gmail.com' as my SMTP server, defined my gmail user credentials but apache2 shows:

    "PHPMailer error: SMTP Error: Could not connect to SMTP host." in file /var/www/elgg/mod/phpmailer/mail.php (line 140)

    Could it be because I defined in my gmail account that this user should always use SSL when connecting via HTTP? Does this plugin support SSL SMTP connection?



  • did anyone solved the problem with gmail? I defined the port number in mail.php but I still get an error:

    WARNING: 2009-11-23 01:59:44 (CET): "fsockopen() [<a href='function.fsockopen'>function.fsockopen</a>]: unable to connect to ssl://smtp.google.com:465 (Connection timed out)" in file /var/www/elgg/mod/phpmailer/lib/class.smtp.php (line 122)
    WARNING: 2009-11-23 01:59:44 (CET): "PHPMailer error: SMTP Error: Could not connect to SMTP host." in file /var/www/elgg/mod/phpmailer/mail.php (line 141)



  • GVGTER - I answered your question in response to ShonoSF above.

  • well, I did read that and did a search with no success :( So the question is if someone did try any modifications with some positive results.



  • The google search is: phpmailer gmail

  • hi Cash,

    do you have any thoughts for alternate text/HTML messages?

    For example, in start.php changing phpmailer_send() call to:
    return phpmailer_send($from_email, $from_name, $to->email, '', $subject, $message, null, isset($params['html'])? $params['html']:null);

    Then notify_user() calls can add optionally set $param['html']...

    ...and in mail.php, about line #98 where its: $phpmailer->IsHTML(true);

            $phpmailer->AltBody = $body;
            $body = $html;

    i.e. so if $html is === true (bool), assume $body is HTML, else HTML could be set as a separate param.

    PS: when installing I noted (on OSX) the files inside the ZIP are not readable by others (i.e. apache), might be what's affecting a few others when installing (could be an OSX thing though)


  • Mark, most people FTP the files to their server which sets their permissions.

    Regarding HTML email, what you suggest sounds reasonable. I think you could also hard code html to true since a plan text email encoded as html should still work - haven't tried that though.

  • Thanks for this Plug-In: It works perfect.

  • The SMTP is not a must?

  • I have installed this plugin, and set my SMTP host, Username and password, but the headers I recieve give no indication of phpmailer use or my website email address...

    Return-Path: <activity@cs1.uhcloud.com>
    Delivered-To: m@mgjb.org
    Received: from virus_12.livemail.co.uk (virus-cluster.livemail.co.uk [])
        by smtp-in-75.livemail.co.uk (Postfix) with SMTP id 27DA2CCCD40
        for <m@mgjb.org>; Tue, 12 Jan 2010 16:31:51 +0000 (GMT)
    X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on
    X-Spam-Level: **
    X-Spam-Status: No, score=2.2 required=5.0 tests=FH_FROMEML_NOTLD
        autolearn=disabled version=3.2.5
    Received: from smtpout01.uhcloud.com (smtpout01.uhcloud.com [])
        by smtp-in-160.livemail.co.uk (Postfix) with ESMTP id BD23C26002B
        for <m@mgjb.org>; Tue, 12 Jan 2010 16:31:50 +0000 (GMT)
    Received: from cs1.uhcloud.com ([])
        by smtpout01.uhcloud.com with esmtp (Exim 4.63)
        (envelope-from <activity@cs1.uhcloud.com>)
        id 1NUjoM-0005gu-9w
        for m@mgjb.org; Tue, 12 Jan 2010 11:41:42 -0500
    To: m@mgjb.org
    Subject: Re: [Listserve email functionality]
    From: Activity_Seeker_Website_Group
    Content-Type: text/plain; charset=UTF-8; format=flowed
    MIME-Version: 1.0
    Content-Transfer-Encoding: 8bit
    Date: Tue, 12 Jan 2010 11:34:14 -0500
    Message-Id: <1263314054.17388@cs1.uhcloud.com>
    X-Original-To: m@mgjb.org
    X-AntiVirus: checked by Vexira MailArmor


    What do I need to do to remedy this please??

  • If it is going through your smtp server, it must be working. What is the problem?

  • Hi Cash... lots actually, it is going through my server smtp, not mine. I want to get Listserve working on my site, it uses phpmailer too, but I thought I'd try this out because I can not find a way to get the from address as being from my web address.  No matter what I do it always comes via my server, and for Listserve this is useless as the return address needs to be my domain catchall for the cron task to find it.

    In the plugin settings my mail host is set as mail.activityseeker.com, but goes through smtpout01.uhcloud.com. Header says "Received: from cs1.uhcloud.com"... it should be contact@activityseeker.com.

    If I knew how to set this up, I could apply it to the Listserve plugin as well (perhaps if I can work it all out).  activity@cs1.uhcloud.com needs to be contact@activityseeker.com

  • 1. Make sure "Override default Elgg mail handler" is checked

    2. Make sure all other plugins that override the mail handler are turned off

    3. Your "From email address" is set under Site Administration

    4. If there are errors with PHPMailer, they should be written into your server error log.


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

Other Projects

View Cash's plugins