• Please change class-phpmailer in wp-includes to support Google Apps SSL email. In version 2.63, this starts at line 536 and reads:

    if(strstr($hosts[$index], ":"))
                    list($host, $port) = explode(":", $hosts[$index]);
                else
                {
                    $host = $hosts[$index];
                    $port = $this->Port;
                }

    To make it work for Google Apps, it has to support pulling the port off the end, but also allow for ssl:// at the start of the host name because ssl://smtp.gmail.com:465 is what works to connect. So here’s what you change it to:

    $i=strrpos($hosts[$index], ":");
        if($i > 0) {
            $host = substr($hosts[$index],0,$i);
            $port = substr($hosts[$index],$i+1,strlen($hosts[$index])-$i);
        }
        else
        {
            $host = $hosts[$index];
            $port = $this->Port;
        }

    Then you can use the wp-mail-smtp plugin to enable SMTP over ssl://smtp.gmail.com:465 and it just works.

    HTH,
    Bret

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    Actually, the PHPMailer class supports ssl without that modification. All you have to do is to set $phpmailer->SMTPSecure = “ssl”.

    So it sounds like the plugin needs to recognize the SSL prefix, pull that off, and then set the secure option in the phpmailer object accordingly.

    Thread Starter bret.miller

    (@bretmiller)

    In what version does that work? A grep of my wordpress files doesn’t find “SMTPSecure” in any .php file, and setting it certainly doesn’t work for me. It hangs for a bit and says “Called Reset() without being connected”.

    [removed debug output]

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    Huh. Okay, sorry, I guess I was looking at a newer version that is in WordPress 2.7. I didn’t realize that that file had been updated to a later version.

    Anyway, this new version is in WordPress 2.7, and it does work there, so there you go. 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Request: Fix class-phpmailer to support SSL connections’ is closed to new replies.