Welcome Guest, Not a member yet? Register   Sign In
email bug
#7

[eluser]g_montel[/eluser]
I'm experiencing the same problem.
I'm running CI 1.7.2 on a xampp server version 1.7.3 on windows xp.

I'm sending an email with the following code :

Code:
log_message('debug', '[Contact_model.save_contact_form_and_send_email_to_admins] before sending email');

        // send email to admins
        $this->load->library('email');
        log_message('debug', '[Contact_model.save_contact_form_and_send_email_to_admins] debugger = '.$this->email->print_debugger());
        $this->email->to($this->config->item('myapp_administrator_emails'));
        $this->email->from($this->config->item('myapp_do_not_reply_email'),$this->config->item('myapp_do_not_reply_name'));
        $this->email->subject($this->config->item('myapp_name').' | new form received on the website');
        $body = 'Date : '.mdate($datestring)."\r\n"
        .'Sender IP address : '.$ip_address."\r\n"
        .'Sender user agent : '.$user_agent."\r\n"
        .'Sender name : '.$name."\r\n"
        .'Sender email : '.$email."\r\n"
        .'Subject : '.$subject."\r\n"
        .'Message : '.$message."\r\n";

        $this->email->message($body);
        
        log_message('error', '[Contact_model.save_contact_form_and_send_email_to_admins] before email->send');
        
        if (!$this->email->send())
        {
            log_message('error', '[Contact_model.save_contact_form_and_send_email_to_admins] unable to send email to '.$this->config->item('myapp_administrator_emails'));
        }
        else {
            log_message('error', '[Contact_model.save_contact_form_and_send_email_to_admins] email sent to '.$this->config->item('myapp_administrator_emails'));        
        }
        
        log_message('error', '[Contact_model.save_contact_form_and_send_email_to_admins] after email->send');

The mail IS sent and arrives on my mailbox.

But the $this->email->send() function just never returns.

Here are the logs :
Code:
DEBUG - 2010-11-22 11:24:03 --> [Contact_model.save_contact_form_and_send_email_to_admins] before sending email
DEBUG - 2010-11-22 11:24:03 --> Email Class Initialized
DEBUG - 2010-11-22 11:24:03 --&gt; [Contact_model.save_contact_form_and_send_email_to_admins] debugger = <pre>

</pre>
ERROR - 2010-11-22 11:24:03 --&gt; [Contact_model.save_contact_form_and_send_email_to_admins] before email->send

The following PHP code
Code:
echo "trysendmail.php\n";
$from_name = "xxx";
$from_email = "[email protected]";
$headers = "From: $from_name <$from_email>";
$body = "Hi, \nThis is a test mail from $from_name <$from_email>.";
$subject = "Test mail from Justrealized";
$to = "[email protected]";

if (mail($to, $subject, $body, $headers)) {
  echo "success!";
} else {
  echo "fail…";
}

works, is sending the mail, and prints "success!".

Any hint ?
Many thanks in advance

Geoffroy


Messages In This Thread
email bug - by El Forum - 01-29-2010, 12:02 PM
email bug - by El Forum - 01-31-2010, 05:45 PM
email bug - by El Forum - 01-31-2010, 06:06 PM
email bug - by El Forum - 01-31-2010, 06:33 PM
email bug - by El Forum - 01-31-2010, 06:38 PM
email bug - by El Forum - 01-31-2010, 07:11 PM
email bug - by El Forum - 11-22-2010, 04:30 AM
email bug - by El Forum - 11-22-2010, 05:00 AM
email bug - by El Forum - 11-22-2010, 05:18 AM
email bug - by El Forum - 03-10-2011, 11:17 AM
email bug - by El Forum - 03-10-2011, 11:18 AM



Theme © iAndrew 2016 - Forum software by © MyBB