View Full Version : Failed to connect socket

11-13-2007, 01:49 PM
I have written a simple php mailing script using mail peer. My code is as follows-

require_once "Mail.php";
$from = "TAnvir Sender <bhonest_4ever2007@yahoo.com>";
$to = "Tonu Recipient <tanvirtonu@yahoo.com>";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
$host = "ssl://smtp.mail.yahoo.com";
//$host = "smtp.mail.yahoo.com";

$username = "bhonest_4ever2007";
$password = "abcdefg";

$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 successfully sent!</p>");

Now I mgetting this error-

Failed to connect to ssl://smtp.mail.yahoo.com:465 [SMTP: Failed to connect socket: Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? (code: -1, response: )]

Pls help me.I m using an installer of Apache, MySQL and PHP for Windows called XAMPP 1.6.4 which is a Apache distribution for windows.I dont know how to recompile php with ssl. Bcos all I did to install php is I just installed Xampp installer.It did the rest.Help me.

11-13-2007, 05:05 PM
Is the module enabled in your php.ini?

11-14-2007, 08:07 AM
Is the module enabled in your php.ini?

Which module r u talking about.I m a newbie

11-14-2007, 07:00 PM
The OpenSSL module. Make a page with this in it:

And look at the installed modules for OpenSSL.