I have smtp mail and i am sending verification mail of account at webproject. Webprject is developed using codeigniter 3.0.
I tested with using gmail, it was working perfectly. Now i have to put smtp mail instead of gmail. It does not seem to have successful connection to the smtp account.
$config['protocol'] = 'smtp';
$config['smtp_host'] = 'mail.company.com'; //change this
$config['smtp_port'] = '587';
$config['smtp_user'] = 'support@company.com'; //change this
$config['smtp_pass'] = '******'; //change this
$config['smtp_crypto'] = 'tls';
$config['mailtype'] = 'html';
$config['charset'] = 'iso-8859-1';
$config['wordwrap'] = TRUE;
$config['newline'] = "\r\n";
Received error like this
A PHP Error was encountered
Severity: Warning
Message: stream_socket_enable_crypto(): Peer certificate CN=`outlook.com' did not match expected CN=`mail.company.com'
Filename: libraries/Email.php
Line Number: 1978
The error you get refer to "mail.company.com", which is a bogus address, I suppose. I think it's the reason why you get this error. To use SMTP, you need a real SMTP account, not a bogus one. This is why there is the "change this" comments in your code. You should actually change those lines, and put the real credential.