CodeIgniter Forums
Gmail SMTP using SSL/TLS - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Development & Programming (
+--- Thread: Gmail SMTP using SSL/TLS (/showthread.php?tid=9828)

Pages: 1 2 3 4

Gmail SMTP using SSL/TLS - El Forum - 04-07-2009

Worked great and fixed my smtp problem!


Gmail SMTP using SSL/TLS - El Forum - 05-23-2009

my ISP just blocked port 25 outgoing so i had to figure out how to get around it.

i just implemented this google smtp set up and it is working great - even using google apps with my own domain.

i had one problem that is worth mentioning... i forgot to add the crucial line:

and it resulted in an 500 "Internal Server Error" page and php_wrapper.cgi message in the php error log. so i ended up going on a wild goose chase. eventually, i realized that i had left out the set_newline() call.

moral of the story: make sure you set_newline() as described by the OP.

Gmail SMTP using SSL/TLS - El Forum - 07-06-2009

Looks so great, just one small thing... I put all the params into email.php and the page "hangs" forever, even though the timeout is set to 30 secs. no echo with debug either (i used to get it before making other mistakes). any idea what can be happening?
thanks in advance!!!

$config['smtp_user']='my gmail';
$config['smtp_pass']='my gmail pass';

the controller

$this->email->from('[email protected]','tralalala');
$this->email->message('live! damn it...');
echo $this->email->print_debugger();

Gmail SMTP using SSL/TLS - El Forum - 07-06-2009

you need to use double-quotes on your
- single quotes do not work.

Gmail SMTP using SSL/TLS - El Forum - 07-06-2009

So simple... thank you!!! :lol:

Gmail SMTP using SSL/TLS - El Forum - 07-07-2009

you are welcome! and thank YOU for *posting code* so the problem was immediately apparent. i wish other people asking questions in these forums were as proactive! :-)

Gmail SMTP using SSL/TLS - El Forum - 07-15-2009

[eluser]Carlos Alcala[/eluser]
Hey Forum.

I made a custom defined using constants.php file on config/constants.php and then developed a custom smtpconfig function on a controller model to suit the smtp email configuration and the use on a send emailtest function on a controller, please visit my weblog to view the solution:

Just for the note, I have found that PASSING an string array from config/email.php to the library email constructor (load library) has the bug like the initialize on the SMTP_AUTH so the Gmail test nevers authenticates, I have found after several hours of dev/test.

I hope you like this solution, using gmail and it works fine !!

PS. For Windows XAMP users: uncomment the line extension=php_openssl.dll on the php.ini to work with SSL

Gmail SMTP using SSL/TLS - El Forum - 07-29-2009

hi.I worked out the code you gave..It shows that "your email is sent" ..but it is not actually sending out the mail..
here the code

class Test_email extends Controller
function Test_email()
// load controller parent
function sendEmail()

$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://',
'smtp_port' => 465,
'smtp_user' => '[email protected]',
'smtp_pass' => 'pwd',
$this->load->library('email', $config);

$this->email->from('[email protected]', 'Smitha');
$this->email->to('[email protected]');

$this->email->subject(' CodeIgniter Rocks ');
$this->email->message('Hello World');

if (!$this->email->send())
echo 'Your e-mail has been sent!';


why is this happening?I had openssl enabled..but still the same problem

Gmail SMTP using SSL/TLS - El Forum - 08-01-2009

[eluser]Carlos Alcala[/eluser]
1. I have made the configuration usign constants with DEFINE for ONE SIMPLE REASON, the email library has a bug using an ARRAY CONFIGURATION LOAD LIKE IN YOUR CODE, I have made it that way also with NO SUCCESS, and it seems a problem on the email library constructor usign it that way, so please FOLLOW THE EXAMPLE EXACTLY.

2. Check the port 465 is open on firewall.

3. The show_errors is not showing anything?

4. Are you using a correct Gmail account and password? because you posted a code taht seems a little different from my code.

5. Please follow the code correctly using de DEFINE on the constants.php on my website and then post your results.

6. Please try to verify any errors.

Hope you can get work, this seems a missunderstood problem on your code.



Gmail SMTP using SSL/TLS - El Forum - 08-02-2009

thank you.. can u please post me your code?
465 is open.
and email address i gave i s valid one..