how to correct way to send email using codeigniter how to correct way to send email using codeigniter codeigniter codeigniter

how to correct way to send email using codeigniter


For security reasons, Google's e-mail servers require SSL or TLS in order to send mail. It doesn't use the standard unencrypted port 25 method of doing it.

You basically have two choices. 1) Use sendmail or mail on your own server to deliver the messages, or 2) use the method described here to send e-mail via Google's servers using SSL. Good luck, and I hope it this helps.


You are attempting to send outbound mail via Gmail on standard SMTP port 25. Gmail does not accept unencrypted connections on that port (or any port). You must use port 465 over SSL.

You must change your $config['smtp_port'] to 465 and your $config['smtp_host'] to 'ssl://smtp.googlemail.com'

More info here


You can even use port 587:

$config['smtp_port'] = '587';

and smtp-host as:

$config['smtp_host'] = 'ssl://smtp.gmail.com';