Welcome Guest, Not a member yet? Register   Sign In
XAMPP CI SMTP Timeout
#1

[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
#2

[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




Theme © iAndrew 2016 - Forum software by © MyBB