i try to send mail in codeigniter like this :
public function send()
{
$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'smtp.googlemail.com',
'smtp_port' => 587,
'smtp_user' => '[email protected]',
'smtp_pass' => 'mypass',
'newlin' => "\r\n"
);
$this->load->library('email', $config);
$this->email->set_newline("\r\n");
$this->email->from('[email protected]', 'Admin Re:Code');
$this->email->to('[email protected]');
$this->email->subject('Percobaan email');
$this->email->message('Ini adalah email percobaan untuk Tutorial CodeIgniter: Mengirim Email via Gmail SMTP menggunakan Email Library CodeIgniter @ recodeku.blogspot.com');
if (!$this->email->send()) {
show_error($this->email->print_debugger());
}else{
echo 'Success to send email';
}
}
but i have some error :
220 smtp.googlemail.com ESMTP g15sm4364297pgu.52 - gsmtp
hello: 250-smtp.googlemail.com at your service, [182.253.163.55]
250-SIZE 35882577
250-8BITMIME
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-CHUNKING
250 SMTPUTF8
Failed to send AUTH LOGIN command. Error: 530 5.7.0 Must issue a STARTTLS command first. g15sm4364297pgu.52 - gsmtp Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.
please help me.