In this post I would like to show you configuring Codeigniter email library to send emails using GMail SMTP server. Configuring and sending emails in Codeigniter application is not a tedious task, it is very simple and easy with few lines of code and config values you can send emails. You can set configuration options on fly or you can set config options of email library globally at
Message: mail() [function.mail]: Failed to connect to mailserver at “ssl://smtp.googlemail.com” port 465,
verify your “SMTP” and “smtp_port” setting in php.ini or use
Message: fsockopen() [function.fsockopen]: unable to connect to ssl://smtp.googlemail.com:465
(Unable to find the socket transport “ssl” – did you forget to enable it when you configured PHP?)
If those error occurred, make sure
extension=php_openssl.dll uncommented in php.ini .If you are using xampp make sure you change php.ini in
xampp/apache/bin/php.ini. If php.ini doesn’t exists to that directory, copy php.ini from
$this->email->set_newline enclose with double quotes. This is very important or else it does not work.Because PHP interpreter will consider
\n as new line only when it is in enclosed with double quotes and if it in single quotes interpreter consider it as the literal character. So have a eye on it.
I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face - we are here to solve your problems.
I am Arjun from Hyderabad (India). I have been working as a software engineer from the last 7+ years, and it is my passion to learn new things and implement them as a practice. Aside from work, I like gardening and spending time with pets.