Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Oct 2007
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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-

    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.

  • #2
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    Is the module enabled in your php.ini?

  • #3
    New Coder
    Join Date
    Oct 2007
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #4
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    The OpenSSL module. Make a page with this in it:
    PHP Code:
    <?php
    phpinfo
    ();
    ?>
    And look at the installed modules for OpenSSL.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •