PHPMailer configuration

Hello Community,

I'd like to get some help to solve one of the common problems that newbies face in Elgg version 1.9. Actually, i stil can't send/receive notifications and account validation by mail.

I've already downloaded PHPMailer (last published version) and updated its library from https://github.com/PHPMailer/PHPMailer. Since, i'm working with SMTP server of gmail, i edited the file activate.php of the plugin with gmail settings as shown below:

/**

* Set default plugin settings for PHPMailer
*/

$plugin = elgg_get_plugin_from_id('phpmailer');
if ($plugin) {

$defaults = array(
'phpmailer_override' => 'enabled',
'phpmailer_smtp' => 1,
'phpmailer_host' => 'smtp.gmail.com',
'phpmailer_smtp_auth' => 1,
'phpmailer_username' => 'monmail@gmail.com',
'phpmailer_password' => 'password',
'ep_phpmailer_ssl' => 0,
'ep_phpmailer_port' => 587,
'nonstd_mta' => 0,
);

foreach ($defaults as $name => $value) {
if (!isset($plugin->$name)) {
$plugin->$name = $value;
}
}
}
?>

activated the plugin and nothing seems to work, i don't know what i am doing wrong.

I'd greatly appreciate any kind of help.

Thank you all.

  • Can anyone give me a hint over here?!

    please.

  • The plugin is 3 years old and the maintainer no longer works actively on Elgg.

    You should not need any plugin to send email notifications.

    Disable the plugin and check with your host to see why there might be problems sending email using Elgg's default settings.

  • Thank's for your answer.

    I know that this plugin is quiet deprecated now. 

    Using Elgg's default settings or using the plugin, mails are not sent even on my local server. 

    How can you explain that?

  • I started a new discussion on this problem with a fresh installation. Did you get your issue resolved?

  • Hi,
    Yeah, it is.

    I kept using the same plugin (phpMailer) and I set up the SMTP gmail settings of the plugin so they are same in my server ( if you are having some problem as i had, make sure 'the port and the authentication' are the right ones)

    and luckily this plugin has a settings board where you can configure it fully without diving into any code.

     

  • I may have to go with that plugin but I would rather not if I don't have too. I also have the problem and think I have discovered the cause but not the solution, you can see my post here. https://community.elgg.org/discussion/view/2047204/validation-email-not-being-received-198-error-shows-in-log

  • I'm getting an error with the php smtp plugin, here is the error:

    Fatal error: require_once() [function.require]: Failed opening required '/home/content/40/5928640/html/hostedsites/weconnectat.ca/hnphockeylondon/mod//phpmailer/vendors/class.phpmailer.php' (include_path='.:/usr/local/php5_3/lib/php') in /home/content/40/5928640/html/hostedsites/weconnectat.ca/hnphockeylondon/mod/elgg-phpmailer-master/start.php on line 123

    Notice in the error after mod it has two // in the url

    Here is line 123 of start.php, I tried figuring it out myself but had no luck.

    require_once elgg_get_plugins_path() . '/phpmailer/vendors/class.phpmailer.php';

    Here is the complete section in case that helps.

    // Ensure phpmailer object exists
        if (!is_object($phpmailer) || !is_a($phpmailer, 'PHPMailer')) {
            require_once elgg_get_plugins_path() . '/phpmailer/vendors/class.phpmailer.php';
            require_once elgg_get_plugins_path() . '/phpmailer/vendors/class.smtp.php';
            $phpmailer = new PHPMailer();
        }

  • Try renaming the plugin 'phpmailer' - look at what it's trying to include and look at what you have it named

  • I didn't name the plugin, that was the name in the zip file. I did rename it as you suggested and that has gotten me closer but I still get an error and can not connect to the SMTP host.

    Currently it appears the built in validation doesn't work, at least for me, if the sub-directory name is different than /elgg. I posted a discussion on it in case someone can provide a solution.

    I'm currently testing installing elgg in a subdomain to see if the email validation will work.