Reputation: 63
In PHP, I am getting this error while sending email:
"fsockopen() [function.fsockopen]: unable to connect to tls://smtp.gmail.com:465 (Connection timed out)".
Can anyone help me to dynamically load openssl.ddl extention through .htaccess file or any other means other than dl().
I am working with Yii and this is how my main.php is:
'mail' => array(
'class' => 'application.extensions.yii-mail.YiiMail',
'transportType'=>'smtp', /// case sensitive!
'transportOptions'=>array(
//'host'=>$smtp_host,
'host'=>'smtp.gmail.com',
//'username'=>$smtp_username,
'username'=>'[email protected]',
//'password'=>$smtp_password,
'password'=>'testtest10',
//'port'=>'543',
'port'=>'465',
'encryption'=>'tls',
//'encryption'=>'ssl',
),
'viewPath' => 'application.views.mail',
'logging' => true,
'dryRun' => false
),
can anyone please let me know where I am wrong....
Upvotes: 0
Views: 2745
Reputation: 63
I solved my problem. Actually this configuration was working in localhost but was giving error in server. Had to change settings to work in server. Changed host value to localhost and changed the username and password to same as in server settings. It is working now.
Upvotes: 1