CodeIgniter Forums

Full Version: Can't send email
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]Brandon Taylor[/eluser]
Hi everyone,

I'm two days into CodeIgniter, so please bear with me. I just have a simple sign up form: first_name, last_name, email, question.

I need to send an email with this information. The relevant portion of my controller:

$email_config = array(
    'protocol' => 'smtp',
    'smtp_host' => '',
    'smtp_user' => 'my_account',
    'smtp_pass' => 'my_password',
    'smtp_port' => 25
$this-> load-> library('email', $email_config);
$this-> email-> set_newline('\r\n');
$this-> email-> from($email, $first_name.' '.$last_name);
$this-> email-> to('[email protected]');
$this-> email-> subject('Question about something, etc');

if(!$this-> email-> message($question))
    show_error($this-> email-> print_debugger());

The debugger outputs nothing. I get an error screen with "An Error Was Encountered" and nothing else.

What am I doing wrong?

El Forum

[eluser]Brandon Taylor[/eluser]
Ugh. I see where I was making the wrong call checking if the mail was sent. I think I'm on the right track now, as I'm getting debugging errors.