Results 1 to 8 of 8

Thread: failed to connect error

  1. #1
    Custom User Title tpoynton's Avatar
    Join Date
    Sep 2004
    Location
    Mass
    Posts
    2,181
    Rep Power
    18

    failed to connect error

    Greetings - have had a script that sends an email working for years that is now throwing this error:

    smtp.powweb.com:25 [SMTP: Failed to connect socket: Connection timed out (code: -1, response: )]

    has something changed?

    edit: full error is

    Failed to connect to smtp.powweb.com:25 [SMTP: Failed to connect socket: Connection timed out (code: -1, response: )]

  2. #2
    target='_blank' snowmaker's Avatar
    Join Date
    Nov 2002
    Location
    West Virginia
    Posts
    3,464
    Rep Power
    22
    I have a PHP script similar to this that sends me an email. I just ran it manually, and it appears to be working fine. Do you use the PHP mail function in your script, or how do you have it setup to send email?

    PHP Code:
    <?
    $mailto 
    'XXX@XXX';
    $headers 'From: Website <XXX@XXX>' "\r\n" 'X-Mailer: PHP/' phpversion();
    mail("$mailto""$headers"Test\n""$headers");
    ?>
    BTW, the email addresses defined in the $mailto and $headers variables are completely and correctly defined in the script..
    -bruce /* somdcomputerguy */
    'If you change the way you look at things, the things you look at change.'

  3. #3
    Custom User Title tpoynton's Avatar
    Join Date
    Sep 2004
    Location
    Mass
    Posts
    2,181
    Rep Power
    18
    Thanks Bruce! sorry for late reply. For some reason I am using PEAR...it has been so long since I messed with it, but I do remember when I setup that I could not use the regular PHP mail for what I wanted to do.

    Error still occuring...I run the page with a .php4 extension, which I think I did to get access to PEAR. PHP has probably been updated once or twice since then, and may be related to the error. The .php4 still works or I wouldnt be getting the error message echoed, right? Appreciate any insight!

    edit- here's the code for mail function...

    PHP Code:
    Function TTMailer($email$thekey) {
        
    $from "me@mywebsite.com <me@mywebsite.com>";
        
    $to $email;
        
    $subject "File Download";
        
    $yourfilepath="http://www.myfilepath.etc";
        
    $body "To download , please click on the link below to complete the email verification process.  If you want to download the file again, you will not need to register your email address again. $yourfilepath/confirm.php?email=$email&thekey=$thekey";
        
    $host "smtp.powweb.com";
        
    $username "me@mywebsite.com";
        
    $password "redactedofcourse";
        
    //$port = "465";
        
    $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 
    '<h3>Oops, you\'ve encountered a problem.</h3>';
          echo(
    "<p>" $mail->getMessage() . "</p>");
          echo 
    "<p>You have encountered a problem with the website, please send an email with the information above to <a href='me@mywebsite.com'>me@mywebsite.com</a>.  My apologies...</p>";
          
    AddRemaining();
          exit;
         } else {
            
    //email successfully submitted
         
    }
    }
    //end form processing 

  4. #4
    target='_blank' snowmaker's Avatar
    Join Date
    Nov 2002
    Location
    West Virginia
    Posts
    3,464
    Rep Power
    22
    I'm not familiar with PEAR at all, but the error messages you are seeing are not the error message text defined in your script, so I would suspect some inner platform (PEAR &| PHP) issues.. Have you opened a service ticket?
    -bruce /* somdcomputerguy */
    'If you change the way you look at things, the things you look at change.'

  5. #5
    Custom User Title tpoynton's Avatar
    Join Date
    Sep 2004
    Location
    Mass
    Posts
    2,181
    Rep Power
    18
    I have not opened a service ticket, but I will give that a go, thanks!

  6. #6
    target='_blank' snowmaker's Avatar
    Join Date
    Nov 2002
    Location
    West Virginia
    Posts
    3,464
    Rep Power
    22
    You bet man. Hope you get it resolved.
    -bruce /* somdcomputerguy */
    'If you change the way you look at things, the things you look at change.'

  7. #7
    Custom User Title tpoynton's Avatar
    Join Date
    Sep 2004
    Location
    Mass
    Posts
    2,181
    Rep Power
    18
    Got a response from support after a couple of days, and it was overall very helpful! They told me to change port to 587, and created a test script to verify this would work...well, changing the port didnt work, but changing the script to regular .php extension did, so I am a happy camper. The test script did not include a specific port, but I keenly noticed the file extension. Guess PEAR mail now works on the updated PHP!

  8. #8
    target='_blank' snowmaker's Avatar
    Join Date
    Nov 2002
    Location
    West Virginia
    Posts
    3,464
    Rep Power
    22
    Glad it got resolved for ya. Happy campin'!
    -bruce /* somdcomputerguy */
    'If you change the way you look at things, the things you look at change.'

Posting Permissions

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