EllisLab text mark
Advanced Search
     
XAMPP CI SMTP Timeout
Posted: 19 July 2012 10:01 AM
Joined: 2012-07-19
2 posts

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

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

Here is the email 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('aGeneralEmail@email.com''GeneralName');
        
$this->email->to('myExchangeEmail@email.com');
        
$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

 
Posted: 20 July 2012 09:40 AM   [ # 1 ]   [ Rating: 0 ]
Joined: 2012-07-19
2 posts
$this->email->set_newline("\r\n"); 

This line, right there. Is needed after the

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


It is working now