Mass mailout plugin for Elgg / Send messages to all users [1.7.X - 2.X] v3.5.1

Release Notes

- Fixed a bug with logged in user guid when triggered by cron job

  • I'm using godadday as a host and elgg 1.8.15, for the cron job setup I set the command path to and then tried to set the path to the elgg cron.php file (engine/lib/cron.php) but with either I cannot get this plugin to send out emails. I keep getting an "Incomplete" displaying the plugin and no email is sent out. Maybe you can help me with this? Cheers

  • @Michaeleg : Please see this tutorial for configuration of elgg cron job.

  • As the command I used: /usr/bin/curl

    but I get this error: "curl: (7) couldn't connect to host"

    The frequency is set to 5 minutes. It is a shared hosting server with godadday. So I really don't know what is going on. Thank you very much for your prompt responce to my first question, I think it was a step in the right direction, but I searched all over the net and just can't figure it out, even tried calling godadddy.

  • @Michaeleg : Have you gone through the comments section of the tutorial? The error code is explained there. Also see

  • looks like godaddy does not have 5 minute frequency for cron jobs, only hourly, i was mistaken. would I need to modify the code for this? I'm looking into see about the firewall issue. Thanks for your help

  • It says "Incomplete" After 10 hours set 5 min cron job on my vps as you told. Help plz.

  • @cicor : it is impossible to debug this plugin with out having an access to the installation environment. You can start troubleshooting it yourself by

    1. make sure cron is configured properly -
    2. Make sure cron jobs are running -
    3. Check whether any of your users are getting messages.
    4. Check whether your server is configured for outgoing mails.
  • i've been using this plugin recently, thanks.

    yesterday i saw that i had included a & symbol in the message subject and it had been sent out as including the coded version of the & symbol instead of the correct & symbol (e.g. &). i am using coldtrick's html email handler plugin ( and wasn't sure whether mass mail or their plugin was the cause of the error.
    they think their code is correct (i haven't done any testing here).. so i am wondering if the webgalli coders have any comment as to why they think this has occurred?


  • @ura : which version of elgg it is?

  • I am thinking of scrapping concept from this pluggin to create a pluggin that only saves email addresses of all site users to a text file in csv format which can then be downloaded (and deleted) from ftp (or from admin panel in an improved version). This way we would be able to to mass email without using server resources and use our favourite newsletter sender like mailchimp or google apps mailing list (which are way sturdier).

    Any hints or tips?

  • @topgun : You can use the same logic with in the plugin, to save the user email to a text / csv file and then download this file via ftp.

  • Done it and works like a charm. Sharing here if any one else needs to do the same, he wont need to reinvent the wheel.

    In start.php, I made the following edit to the email sending loop:

    		foreach ($emails as $email) {
    			$to = $email->email;
    			if ($to && is_email_address($to)) { //edited the loop here ~~~~~~~
                               $handle = fopen("useremails.txt", "a"); //open file
                               fwrite($handle, $to); //add email
                               fwrite($handle, ", "); //add comma and a space
                               fclose($handle); //close file
    			   //elgg_send_email($from, $to, $subject, $message); [original line]

    Now loading or running cron saves all the user emails to useremails.txt (in the main public_html folder of elgg installation) instead of emailing them on sending external mail from admin panel menu of the plugin - it can be downloaded via ftp and deleted so that no one else can download it by forced browsing. Exported it to my google apps email list (can be mailchimp or anything else too).

    This code is just the modification of same pluggin (I am not a programmer so coding one from scratch would have been hectic) and intentionally disables actual functionality of the plugin by commenting out elgg_send_email part (since I didn't want to use server email resources and overload it). So it would be great if anyone can create a new plugin out of it under GPL that only saves emails or maybe you guys can add this as an additional functionality to your plugin. Do inform me though ;)


  • Hi Topgun. I see it uses a comma and a space between email addresses. What needs to be added if you wish to change 

    fwrite($handle, ", "); //add comma and a space

    To insert a new line between each email address after the comma?

  • Hi,

    I'm not a php developer myself, (I don't know much of the syntax, that is).. .so I just googled the syntax and tried my own logic ending up with this code which worked for me. If you wish to add a line break after each email address and a comma, you will have to google for php syntax for line break and insert it in a similar way into the code right before the "//close file" line so that it looks like:

    fwrite($handle, "LineBreakSyntax ");

    Hope that works for you. If it doesn't you might want to import it into an excel file as the resulting file is in CSV format and an excel spreadsheet will automatically put it in different cells / lines.

  • Thank you TopGun for your response. I SHOULD KNOW the answer and I do. Use this syntax

                               fwrite($handle, ", \n"); //add comma and a space


    Works like a charm :)


  • have we got a mass emailer for 1.9.20

    note: and i know we on 1.10 but i need to let my members know about the upgrade

  • @darkdaz:

    have we got a mass emailer for 1.9.20 

    note: and i know we on 1.10 but i need to let my members know about the upgrade

    This plugin should work in 1.9 / 1.10 with out any issues. Please try it and let us know.

  • Fecn News, thanks. Should have thought of that :)

  • i am sorry for the delay to Team Webgalli's posts, anyway yes it does work,

    also like to report that the mass email plugin is working for 1.11.2 version aswell

    and so does the Webgalli mail plugin works with the latest aswell


Team Webgalli

Leading Elgg developers India. We provide Elgg development, consultation and optimizations. To know more about our Elgg services and for cool elgg stuffs visit us


  • Category: Communication
  • License: GNU General Public License (GPL) version 2
  • Updated: 2016-8-22
  • Downloads: 7319
  • Recommendations: 31

Other Projects

View Team Webgalli's plugins