CodeIgniter Forums
Codeigniter and Smtp.com - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Codeigniter and Smtp.com (/showthread.php?tid=31351)



Codeigniter and Smtp.com - El Forum - 06-15-2010

[eluser]Unknown[/eluser]
Hi. I've been using Codeigniter for a while now but I cant get it to work with my smtp server Smtp.com. My code is:

Code:
$config = Array(
    'protocol' => 'smtp',
    'smtp_host' => 'smtp.com',
    'smtp_port' => 2525,
    'smtp_user' => '[email protected]',
    'smtp_pass' => 'accountpassword'
);
$this->load->library('email', $config);

$this->email->from('[email protected]', 'Account Manager');
$this->email->to('[email protected]');
$this->email->subject('Subject');
$this->email->message('Message');
if ($this->email->send() == FALSE){
    echo 'false';
}
else{
    echo 'true';
}

The email is sent from my shared host IP instead of Smtp.com. I tested my account on Thunderbird and it worked. I've been trying to make it work for hours and all I can do for now is to ask for a little help.

Thanks.


Codeigniter and Smtp.com - El Forum - 06-16-2010

[eluser]Ener1[/eluser]
Hi Tomassi, here you´ll find a great tutorial for mail sending with CI.

Hope it helps