Welcome Guest, Not a member yet? Register   Sign In
Failed using an SMTP server to send emails
#2

[eluser]bagwaa[/eluser]
I don't know if it was the forums, but the double and single quotes seemed to be off, I modified the code slightly and removed one of the sends you didn't need and this seemed to work :-

function index() {

$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => 465,
'smtp_user' => '[email protected]',
'smtp_pass' => 'passhere',
'smtp_timeout' => 10,
'priority' => 3,
'mailtype' => 'text/html',
'charset' => 'iso-8859-1',
'wordwrap' => TRUE
);

$this->load->library('email', $config);
$this->email->set_newline("\r\n");
$this->email->from('[email protected]', 'Mr Smith');
$this->email->to('[email protected]', 'Mr Jones');
$this->email->subject('This is the Subject');
$this->email->message('Message');

if (!$this->email->send()) {
$vars['error_messages'] = show_error($this->email->print_debugger());
} else {
$vars['success_messages'] = "Message has been sent";
}
$this->email->clear();

}


Messages In This Thread
Failed using an SMTP server to send emails - by El Forum - 10-06-2009, 02:35 AM
Failed using an SMTP server to send emails - by El Forum - 10-06-2009, 04:28 AM
Failed using an SMTP server to send emails - by El Forum - 10-08-2009, 12:13 AM



Theme © iAndrew 2016 - Forum software by © MyBB