CodeIgniter Forums
Gmail mailing error - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Gmail mailing error (/showthread.php?tid=51017)



Gmail mailing error - El Forum - 04-17-2012

[eluser]Unknown[/eluser]
<?php

Class Community extends CI_Controller{


function index(){

$config = Array(

'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => 587, //I've also tried using port 465
'smtp_user' => '[email protected]',
'smtp_pass' => 'xxxx',
'mailtype' => 'html',
'charset' => 'iso-8859-1'


);

$this->load->library('email', $config);
$this->email->set_newline("\r\n");

$this->email->from('[email protected]', 'xyz');
$this->email->to('[email protected]');
$this->email->subject('Yadyaydayayayyayaada');
$this->email->message('ayyaydyadydydyaydaydyaydyaydya');

if($this->email->send()){

echo 'Your email is sent, foo!';

}else{

show_error($this->email->print_debugger());

}

}


}

I googled for a solution for 4 hours, and all I could get is uncommenting the openssl line in php.ini (I don't even have that!), I manually added that one.

But the codes above still gave me this error ->

A PHP Error was encountered

Severity: Warning

Message: fsockopen() [function.fsockopen]: unable to connect to ssl://smtp.googlemail.com:443 (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. )

Filename: libraries/Email.php

Line Number: 1689

If anyone can help me here, I would be really really thankful. Thanks Big Grin


Gmail mailing error - El Forum - 04-18-2012

[eluser]gRoberts[/eluser]
It's highly likely that your server does not have OpenSSL or an implementation of SSL installed, so it's unable to create an SSL connection to GMail's servers.


Gmail mailing error - El Forum - 04-18-2012

[eluser]CroNiX[/eluser]
@gRoberts PHP will produce an error stating that SSL was not enabled on the server if that was the case.

GMail had a pretty wide service outtage yesterday. That could be your problem.
http://www.engadget.com/2012/04/17/gmail-outage/