I am working on a php codeigniter project and I want to send emails from my localhost.
Below are my controller functions.
$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.google.com',
'smtp_port' => 465,
'smtp_user' => 'sender@gmail.com',
'smtp_pass' => 'password'
);
$this->load->library('email',$config);
$this->email->set_newline("\r\n");
$this->email->from("sender@gmail.com");
$this->email->to("receiver@gmail.com");
$this->email->subject("Email with Codeigniter");
$this->email->message("This is email has been sent with Codeigniter");
if($this->email->send())
{
echo "Your email was sent.!";
} else {
show_error($this->email->print_debugger());
}
Please note that I allow the extension 'extension = php_openssl.dll' in php.ini. My php.ini file is located in C: / AppServ / php5. When I run the code, my page loads with errors.
These are the errors:
The following SMTP error occurred: 1923818231 Could not find the ssl transport socket - did you forget to enable it when you configured PHP? Failed to send data: AUTH LOGIN Failed to send AUTH LOGIN command. Error: Unable to send data: MAIL FROM:
Severity Level: Warning
: date(): . date.timezone date_default_timezone_set(). , , , , . "UTC" , , , date.timezone, .
: libraries/Email.php
: 705