Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-13-2007, 01:49 PM   PM User | #1
tanvirtonu
New Coder

 
Join Date: Oct 2007
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
tanvirtonu is an unknown quantity at this point
Failed to connect socket

I have written a simple php mailing script using mail peer. My code is as follows-
PHP Code:
<?php
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";

$port='465';
$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-
Quote:

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.
tanvirtonu is offline   Reply With Quote
Old 11-13-2007, 05:05 PM   PM User | #2
Inigoesdr
Super Moderator


 
Inigoesdr's Avatar
 
Join Date: Mar 2007
Location: Florida, USA
Posts: 3,601
Thanks: 2
Thanked 397 Times in 390 Posts
Inigoesdr is a jewel in the roughInigoesdr is a jewel in the roughInigoesdr is a jewel in the rough
Is the module enabled in your php.ini?
Inigoesdr is offline   Reply With Quote
Old 11-14-2007, 08:07 AM   PM User | #3
tanvirtonu
New Coder

 
Join Date: Oct 2007
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
tanvirtonu is an unknown quantity at this point
Quote:
Originally Posted by Inigoesdr View Post
Is the module enabled in your php.ini?
Which module r u talking about.I m a newbie
tanvirtonu is offline   Reply With Quote
Old 11-14-2007, 07:00 PM   PM User | #4
Inigoesdr
Super Moderator


 
Inigoesdr's Avatar
 
Join Date: Mar 2007
Location: Florida, USA
Posts: 3,601
Thanks: 2
Thanked 397 Times in 390 Posts
Inigoesdr is a jewel in the roughInigoesdr is a jewel in the roughInigoesdr is a jewel in the rough
The OpenSSL module. Make a page with this in it:
PHP Code:
<?php
phpinfo
();
?>
And look at the installed modules for OpenSSL.
Inigoesdr is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:38 PM.


Advertisement
Log in to turn off these ads.