views:

38

answers:

1

Hi,

I'm trying to send emails through localhost (XAMPP Windows 1.7.3 installation), but I've been trying for hours with no success.

This is the last code I tried:

$config = Array(
      'protocol' => 'smtp',
      'smtp_host' => 'ssl://smtp.gmail.com',
      'smtp_port' => 465,
      'smtp_user' => '[email protected]',
      'smtp_pass' => 'mypassword',
    );


    $this->load->library('email', $config);
    $this->email->set_newline("\r\n");

    $this->email->from('[email protected]', 'My Name');
    $this->email->to('[email protected]');


    $this->email->subject('Email Test');
    $this->email->message('Testing the email class.');

     if($this->email->send())
     {
     echo 'Your email was sent.';
     }
     else
     {
     show_error($this->email->print_debugger());
     }

Whenever I tried to load this the page shows that it's loading but nothing happens. Is there anything I need to setup in my server to insure email delivery?

I messed with php.ini and sendmail's config a bit with no luck. And openSSL isn't available in case that matters.

Any idea what's wrong?

A: 

Ensure that php_openssl.dll and php_smtp.dll are enabled in your php.ini (the one in the apache/bin/ folder of your install).

Why isnt opensll availabile?

DRL
Don't know really. I tried to manually add the line to load them but it gives me an error that it can't find the library. I download OpenSSL but I have no idea how to install it in my XAMPP installation. Any ideas?
KeyStroke
Did you restart apache after you added then to reload the config? And ensure that libeay32.dll and ssleay32.dll are in apache/bin ?
DRL
Ok it seems like it might have worked now (adding SSL). But still trying to send email with the above code is not responding. The page seems like it's loading for ever.
KeyStroke
smtp_user should be your gmail username smtp_pass sould be your gmail password.I have just tested this code from my xampp install here using my gmail address and it works well.
DRL
ok so I found SSL is enabled, but the code still doesn't load at all. The browser shows "loading" but no response.
KeyStroke
It seems like you must have some other problem with your set up; have you tried to upgrade xampp, or a fresh install (i know that sounds like a cop out but there isnt much else i can suggest). Back up your existing xampp directory and upgrade/install
DRL