No Email Notifications, almost

I just got through install and added in most of the plugins. I'm testing things out using 5 email address's. Elgg has sent out email twice when I hit reset password on a user account as an admin. NO confirmation emails sent from hitting register. I have elgg in a subdirectory. The emails on this .com are handled by Google Apps. I looked on the Troublshooting Wiki for help and could not figure it out.

  • i am having a problem that when new comments are posted no emails are sent? me also installed in a subdomain. any idea?

  • elgg used to have on previous versions a phpmailer function where you could specify a smtp server.... on this new version elgg just calls php mail function. In my case my server is configured to "ignore" php mail() for security reasons and they ask me to use another server.....

    So in my needs of having a SMTP send I donwloaded the phpmailer from sourceforge.net, uploaded the folder outside the elgg folder and created a php "elgg smtp send" function.

    The elgg smtp send looks like:

    <?php

    function elggMail($to, $subject, $body, $type)
        {
            require("class.phpmailer.php");
            $PHPmailer = new PHPMailer();
            $PHPmailer->IsSMTP();                                          // set mailer to use SMTP
            $PHPmailer->Host = "localhost";                  // specify main and backup server
            $PHPmailer->SMTPAuth = false;                     // turn on SMTP authentication
            $PHPmailer->Username = "xxxx@xxx.com";      // SMTP username
            $PHPmailer->Password = "xxxx";             // SMTP password
            $PHPmailer->SMTP_PORT = 25;

            $PHPmailer->From = "xxxxxx@xxx.com";
            $PHPmailer->FromName = "xxx name";
            $PHPmailer->AddAddress($to);            // To

            $PHPmailer->IsHTML($type);                                      // true or false

            $PHPmailer->Subject = $subject;
            $PHPmailer->Body    = $body;
            //$PHPmailer->AltBody = "This is the body in plain text for non-HTML mail clients";

            $resultado = true;
            if(!$PHPmailer->Send())
            {
               $resultado = false;
               echo "". $PHPmailer->ErrorInfo;
            }
           
            return $resultado;
           
        }

    ?>

    this function is placed on the same folder the phpmailer is located.

    Now here comes the tricky part, you need to modify /engine/lib/notification.php

    modify the function:    "function email_notify_handler"

    and add the following line on the beggining of it:

    require($_SERVER['DOCUMENT_ROOT'].'/smtpmail/elggMail.php');

     

    And then modify the line that says "mail (.....)" to:

        elggMail($to, $subject, wordwrap($message), false);
        header('Location: http://elggsite' ) ;

  • I'm put the phpmailer in my public_html

    I understand that i have to save this php code as elggMail.php in  directory smtpmail/

    and in engine/lib/notification.php i have to add this line:

     require($_SERVER['DOCUMENT_ROOT'].'smtpmail/elggMail.php');

    after  line:

    function email_notify_handler(ElggEntity $from, ElggUser $to, $subject, $message, array $params = NULL)
        {

    and in the notification.php

    i have to replace:

     mail($to, $subject, wordwrap($message), $headers);

    to:

    elggMail($to, $subject, wordwrap($message), false);header('Location: <a href="http://myelgg.site" style="text-decoration: underline;">view link</a>' );

    in finaly a have balnk page whati do wrong?

  • I'll be releasing a phpmailer plugin this week if you'd rather wait for that.