Show
Ignore:
Timestamp:
04/15/2008 11:12:28 AM (7 months ago)
Author:
Shadowhand
Message:

Fixing #450, thanks Mihai!

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/system/helpers/email.php

    r2373 r2505  
    4949                                empty($config['options']['password']) or $connection->setPassword($config['options']['password']); 
    5050 
     51                                if ( ! empty($config['options']['auth'])) 
     52                                { 
     53                                        // Get the class name and params 
     54                                        list ($class, $params) = arr::callback_string($config['options']['auth']); 
     55 
     56                                        if ($class === 'PopB4Smtp') 
     57                                        { 
     58                                                // Load the PopB4Smtp class manually, due to it's odd filename 
     59                                                require_once Kohana::find_file('vendor', 'swift/Swift/Authenticator/$PopB4Smtp$'); 
     60                                        } 
     61 
     62                                        // Prepare the class name for auto-loading 
     63                                        $class = 'Swift_Authenticator_'.$class; 
     64 
     65                                        // Attach the authenticator 
     66                                        $connection->attachAuthenticator(($params === NULL) ? new $class : new $class($params[0])); 
     67                                } 
     68 
    5169                                // Set the timeout to 5 seconds 
    52                                 $connection->setTimeout(5); 
     70                                $connection->setTimeout(empty($config['options']['timeout']) ? 5 : (int) $config['options']['timeout']); 
    5371                        break; 
    5472                        case 'sendmail':