PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Sun Jul 12, 2020 7:59 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Fri Jul 17, 2009 3:26 pm 
Offline
Forum Newbie

Joined: Thu Jan 22, 2009 10:36 am
Posts: 5
My hosting provider sometimes changed the smtp server, either from localhost to particular SMTP server or from SMTP server to localhost. I want to use Swift_Connection_Multi to automatically adopt the working smtp server, but I found it can NOT change automatically, instead, it only select the first connection to send email.

So, are there anyway to always select the first working SMTP server? This is the function I am using
public static function getSwiftMailer(){


$conn0=new Swift_Connection_SMTP( sfConfig::get("app_smtp_server"), sfConfig::get("app_smtp_port"));
$conn0->setUsername(sfConfig::get("app_smtp_user"));
$conn0->setPassword(sfConfig::get("app_smtp_password"));
$connections[] = $conn0;


$conn1 = new Swift_Connection_SMTP("localhost");
$connections[] = $conn1;

return new Swift(new Swift_Connection_Multi($connections));

}


Thanks for your help.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group