Ignore:
Timestamp:
Mar 3, 2006 11:21:53 AM (7 years ago)
Author:
roundcube
Message:

Improved SMTP error handling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/program/include/rcube_smtp.inc

    r113 r158  
    8282 
    8383    // try to connect to server and exit on failure 
    84     if (PEAR::isError($SMTP_CONN->connect($smtp_timeout))) 
     84    $result = $SMTP_CONN->connect($smtp_timeout); 
     85    if (PEAR::isError($result)) 
    8586      { 
    8687      $SMTP_CONN = null; 
    87       $SMTP_ERROR .= "Connection failed\n"; 
     88      $SMTP_ERROR .= "Connection failed: ".$result->getMessage()."\n"; 
    8889      return FALSE; 
    8990      } 
     
    103104 
    104105          $smtp_auth_type = empty($CONFIG['smtp_auth_type']) ? NULL : $CONFIG['smtp_auth_type']; 
    105                  
    106       if (PEAR::isError($SMTP_CONN->auth($smtp_user, $smtp_pass, $smtp_auth_type))) 
     106          $result = $SMTP_CONN->auth($smtp_user, $smtp_pass, $smtp_auth_type); 
     107           
     108      if (PEAR::isError($result)) 
    107109        { 
    108110        smtp_reset(); 
    109         $SMTP_ERROR .= "authentication failure\n"; 
     111        $SMTP_ERROR .= "Authentication failure: ".$result->getMessage()."\n"; 
    110112        return FALSE; 
    111113        } 
Note: See TracChangeset for help on using the changeset viewer.