Welcome Guest, Not a member yet? Register   Sign In
Error sending email
#1

[eluser]Unknown[/eluser]
Hello guys,

I created a basic controller to test the email class, but it returns a time out error sending the email..

my code is above:
Code:
$this->load->library('Email');
        
        $config['protocol'] = 'smtp';
        $config['charset'] = 'iso-8859-1';
        $config['smtp_host']="mail.phpro.com.br";
        $config['smtp_user'] ="my_login";
        $config['smtp_pass']="my_pass";
        $config['mailtype']="text";
                
        $this->email->initialize($config);
        
        $this->email->from('sender_email', 'Rodrigo');
        $this->email->to('another_email');
        $this->email->subject('Email Test');
        $this->email->message('Testing the email class.');
        
        if ( ! $this->email->send())
        {
            // Generate error
            
        }
        else
        {
                        // Email sent
            echo $this->email->print_debugger();
        }

Anyone can see something wrong on my code ?

Thanks in advance
#2

[eluser]tonanbarbarian[/eluser]
timeout would mean nothing wrong with your code... maybe firewall blocking extenal access?
or server address incorrect
or server address not resolving to ip correctly
#3

[eluser]Sawariya[/eluser]
Hi Beowulf

Nothing wrong with your code...
you try this...If it is not working your chek your library....


$this->load->library('email');
$config['protocol'] = 'mail';
$config['charset'] = 'iso-8859-1';
$config['smtp_host']="mail.phpro.com.br";
$config['smtp_user'] ="my_login";
$config['smtp_pass']="my_pass";
$config['mailtype']="text";

All the best...
#4

[eluser]Unknown[/eluser]
I'm seeing this timeout as well.

The problem stems from line 1611 in Email.php

Code:
while ($str = fgets($this->_smtp_connect, 512))

I can telnet to my smtp port 25 without any problems but this line just hangs the code until php expires the page due to the timelimit.




Theme © iAndrew 2016 - Forum software by © MyBB