ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Google apps SMTP mail - can't get it working

November 11, 2011 7:47am

Subscribe [3]
  • #1 / Nov 11, 2011 7:47am

    deeciduous

    32 posts

    I’m trying to send email via my Google apps account and I’m getting the following error:

    —-
    A PHP Error was encountered

    Severity: Warning

    Message: fsockopen() [function.fsockopen]: unable to connect to ssl://smtp.gmail.com:465 (Connection timed out)

    Filename: libraries/Email.php

    Line Number: 1670
    ...
    ...
    —-

    I’ve updated system/expressionengine/libraries/EE_Email.php to include:

      ‘smtp_port’ => 465,
      ‘crlf’      => “\r\n”,
      ‘newline’      => “\r\n”

    ...And updated /codeigniter/libraries/Email.php to include:

      var   $smtp_port   = “465”;    // SMTP Port
      var   $newline   = “\r\n”;    // Default newline. “\r\n” or “\n” (Use “\r\n”
      var   $crlf       = “\r\n”;

    ...And the SMTP username/password are definitely correct. Is there anything else I can check?

    Cheers

  • #2 / Nov 11, 2011 6:56pm

    Sean C. Smith

    3818 posts

    Hi deeciduous,

    What version of ExpressionEngine are you using? Also could you roll back your changes and then go to the control panel Admin > Email Configuration and choose php mail and then put in your settings. After that, test if your install will send email. If it does great, then we can work on getting SMTP to work for you.

    Sean

  • #3 / Nov 12, 2011 3:36am

    w84me

    95 posts

    I’ve followed the instructions here
    http://ellislab.com/forums/viewthread/169641/
    and it works. Check your openssl

  • #4 / Nov 12, 2011 7:31am

    deeciduous

    32 posts

    Hi Sean,

    I’m using 2.3.1. I’ve rolled back the changes and tested PHP mail successfully. I’ve configured this a number of times before on a different host (1&1) - no problems. I’m on UK-Cheapest now, but I can’t see any reason why this would cause an issue.

    w84me:

    Thanks, I followed those instructions during my original setup. OpenSSL is enabled.

    Cheers

  • #5 / Nov 14, 2011 7:14pm

    Sean C. Smith

    3818 posts

    deeciduous,

    ExpressionEngine can send mail via php as we can see from your test. At this point not being able to do so via smtp is probably due to a setting your host has on the server. You should contact them and see if they can help you there.

    Please let me know how this goes.

    Sean

  • #6 / Nov 18, 2011 1:39pm

    deeciduous

    32 posts

    Hi Sean,

    It turns out my host was blocking port 465. They have since opened and SMTP is working fine.

    Thanks for your help.

  • #7 / Nov 20, 2011 2:25pm

    Sean C. Smith

    3818 posts

    deeciduous,

    glad you got it working now. Am closing this thread, but feel free to post again when you need more help.

    Sean

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases