CodeIgniter Forums
XAMPP CI SMTP Timeout - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: XAMPP CI SMTP Timeout (/thread-53327.html)



XAMPP CI SMTP Timeout - El Forum - 07-19-2012

[eluser]Unknown[/eluser]
Hello everyone,

I cannot seem to understand why I am having an issue with this email. I have search all the Googles and read everything I came across.

The CI site is on a XAMPP Windows PC, the SMTP server (exchange) is on another server within our LAN.

When I think it's sending the email it just timesout with this error

Code:
Fatal error: Maximum execution time of 300 seconds exceeded in C:\xampp\htdocs\system\libraries\Email.php on line 1869

Here is the email code

Code:
<?php

class Email extends CI_Controller
{
function __construct()
{
  parent::__construct();
}

function index()
{

        $config['protocol'] = 'smtp';
        $config['smtp_host'] = '192.168.45.244';
        $config['smtp_port'] = 25;

        $this->load->library('email');
  
        $this->email->initialize($config);
        $this->email->from('[email protected]', 'GeneralName');
        $this->email->to('[email protected]');
        $this->email->subject('Subject: SomeSubject');
        $this->email->message('Something has been updated');
        if($this->email->send())
        {        
         $this->session->set_flashdata('email_status', 'Email sent');  
  
        } else {
  
         $this->session->set_flashdata('email_status', 'Email failed');
        }
}
}

I have no idea why this is not working.

Thanks for assisting


XAMPP CI SMTP Timeout - El Forum - 07-20-2012

[eluser]Unknown[/eluser]
Code:
$this->email->set_newline("\r\n");

This line, right there. Is needed after the

Code:
$this->email->initialize($config);


It is working now