php - SMTP: Failed to connect socket: Unable to find the socket transport "ssl" -
i've been trying able send emails pear on wamp through gmail, , after spending hours setting , figuring out errors getting, thought close, until started getting error:
failed connect ssl://smtp.gmail.com:465 [smtp: failed connect socket: unable find socket transport "ssl" - did forget enable when configured php? (code: -1, response: )]
using code:
<?php require_once "info.php"; require_once "mail.php"; // info.php contains variable $password $from = "me <myemail@gmail.com>"; $to = "me <myemail@gmail.com>"; $subject = "hi!"; $body = "hi,\n\nhow you?"; $host = "ssl://smtp.gmail.com"; $port = "465"; $username = "myemail@gmail.com"; $password = "$password"; $headers = array ('from' => $from, 'to' => $to, 'subject' => $subject); $smtp = mail::factory('smtp', array ('host' => $host, 'port' => $port, 'auth' => true, 'username' => $username, 'password' => $password)); $mail = $smtp->send($to, $headers, $body); if (pear::iserror($mail)) { echo("<p>" . $mail->getmessage() . "</p>"); } else { echo("<p>message sent!</p>"); } ?>
i've gone through , uncommented extension=php_openssl.dll
in (correct) php.ini, , made sure extension_dir
pointing dlls. i've used phpinfo();
, i've seen multiple mentions of ssl:
i see mod_ssl
in loaded modules
.
under mysqlnd
heading has entry ssl: supported
.
and under phar
heading there's entry native openssl support: enabled
.
i've turned off firewall, check, i've restarted computer, , i've checked practically every question mine on site, , still haven't found solution.
i'm @ loss of next. need enable/check working?
open port 465 open smtp.gmail.com in firewall :)
then there may problem host or else,
try this - working me
did allow smtp in gmail
check 'settings' active smtp server in gmail settings.
Comments
Post a Comment