Welcome Guest, Not a member yet? Register   Sign In
Simple Email not sending?
#1

[eluser]whygod[/eluser]
Hi guys,

I have a method below,
Code:
function send_message($email_from, $email_to, $msg)
{
  $this->load->library('email');
  
  $this->email->from($email_from, 'Portfolio');
  $this->email->to('[email protected]');
  
  $this->email->subject('Message from your Portfolio.');
  $this->email->message($msg);
  
  $this->email->send();
  
  return TRUE;
}

It send email but I don't received the email?
What could be the problem of this?

Thank you very much in advanced.
#2

[eluser]TheFuzzy0ne[/eluser]
You should try returning $this->email->send(). If FALSE is returned, then you know something went wrong.

Code:
function send_message($email_from, $email_to, $msg)
{
    $this->load->library('email');

    $this->email->from($email_from, 'Portfolio');
    $this->email->to('[email protected]');

    $this->email->subject('Message from your Portfolio.');
    $this->email->message($msg);

    return $this->email->send();
}

Now add the following logic to your calling controller method:
Code:
if ( ! $this->some_model->send_email($to, $from, $msg))
{
    die($this->email->print_debugger());
}

Now you should have a better idea about what's going on.




Theme © iAndrew 2016 - Forum software by © MyBB