Failed to connect socket

Discussion in 'PHP' started by tanvirtonu, Nov 13, 2007.

  1. #1
    I have written a simple php mailing script using mail peer. My code is as follows-
    
    <?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>");
     }
    ?>
    
    PHP:
    Now I mgetting this error-
    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, Nov 13, 2007 IP
  2. kmap

    kmap Well-Known Member

    Messages:
    2,215
    Likes Received:
    29
    Best Answers:
    2
    Trophy Points:
    135
    #2
    you cannot use yahoo ssl

    Are you using some API

    Regards

    Alex
     
    kmap, Nov 13, 2007 IP
  3. tanvirtonu

    tanvirtonu Peon

    Messages:
    32
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    WHY CANT I USE YAHOO SSL?
     
    tanvirtonu, Nov 14, 2007 IP