Reputation: 314
I am unable to send email via following configuration.
$config = array();
$config['protocol'] = 'smtp';
$config['mailtype'] = 'text';
$config['charset']='utf-8';
$config['crlf']="\r\n";
$config['newline']="\r\n";
$config['priority']=3;
$config['smtp_host'] = 'smtp.office365.com';
$config['smtp_port']=587;
$config['smtp_crypto']="tls";
$config['smtp_user'] = '************';
$config['smtp_pass'] = '************';
$config['smtp_timeout'] = 120;
$this->email->initialize($config);
$this->email->set_newline("\r\n");
I have checked millions of blog and articles. Same configuration is working properly on production but not on staging environment.
Following error is generated:
Message: stream_socket_enable_crypto(): SSL: Handshake timed out
Upvotes: 1
Views: 2380
Reputation: 1483
$config['smtp_host'] = 'smtp.office365.com';
change to
$config['smtp_host'] = 'ssl://office365.com';
Upvotes: 1
Reputation: 1578
Have you check to enable Open SSL module in php.ini
?
If not then check the points below.
php.ini
file;extension=php_openssl.dll
;
char.Then do check. This may help you.
Upvotes: 1