Sending emails with CodeIgniter in a local XAMPP server

Posted by KeyStroke on Stack Overflow See other posts from Stack Overflow or by KeyStroke
Published on 2010-06-18T10:46:31Z Indexed on 2010/06/18 11:13 UTC
Read the original article Hit count: 221

Filed under:
|
|

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?

© Stack Overflow or respective owner

Related posts about email

Related posts about codeigniter