Page 1 of 1
fatal error....
Posted: Fri Feb 20, 2009 6:53 am
by matic07
I get this error:
Fatal error: Uncaught exception 'Swift_ConnectionException' with message 'The SMTP connection failed to start [mail.mydomain.me:25]: fsockopen returned Error Number 110 and Error String 'Connection timed out'' in /home/mydomain/public_html/lib/Swift/Connection/SMTP.php:309 Stack trace: #0 /home/mydomain/public_html/lib/Swift.php(216): Swift_Connection_SMTP->start() #1 /home/mydomain/public_html/lib/Swift.php(101): Swift->connect() #2 /home/mydomain/public_html/test.php(24): Swift->__construct(Object(Swift_Connection_SMTP)) #3 {main} thrown in /home/mydomain/public_html/lib/Swift/Connection/SMTP.php on line 309
How can i fix that?? I've used google and forum search and i haven't found solution:(
Re: fatal error....
Posted: Fri Feb 20, 2009 7:17 am
by Chris Corbyn
The connection is timing out. It sounds like there's a firewall that's blocking the connection.
Re: fatal error....
Posted: Fri Feb 20, 2009 9:01 am
by BrandonMUS
In Swift3 there was a way to add multiple connections to an instance of Swift. This way if one connection was unsuccessful you could use a backup solution. Is this possible in Swift4 or was it removed? I see that a bad connection throws an exception, so is the best way to do this to throw and catch? Or do you have a snippet for a better way?
Re: fatal error....
Posted: Fri Feb 20, 2009 3:40 pm
by matic07
Solution: staff change default SMTP port to 26 and now works
.. const PORT_DEFAULT = 26; ...
Re: fatal error....
Posted: Fri Feb 20, 2009 4:52 pm
by Chris Corbyn
BrandonMUS wrote:In Swift3 there was a way to add multiple connections to an instance of Swift. This way if one connection was unsuccessful you could use a backup solution. Is this possible in Swift4 or was it removed? I see that a bad connection throws an exception, so is the best way to do this to throw and catch? Or do you have a snippet for a better way?
Try/catch can work but there's two transports I still need to document:
Code: Select all
//Switches if a server fails
$mailer = new Swift_Mailer(Swift_FailoverTransport::newInstance(array(
Swift_SmtpTransport::newInstance('server1'),
Swift_SmtpTransport::newInstance('server2')
)));
//Switches after each message sent
$mailer = new Swift_Mailer(Swift_LoadBalancedTransport::newInstance(array(
Swift_SmtpTransport::newInstance('server1'),
Swift_SmtpTransport::newInstance('server2')
)));
Re: fatal error....
Posted: Fri Feb 20, 2009 4:53 pm
by Chris Corbyn
matic07 wrote:Solution: staff change default SMTP port to 26 and now works
.. const PORT_DEFAULT = 26; ...
Good to hear

Re: fatal error....
Posted: Mon Feb 23, 2009 9:46 am
by BrandonMUS
Chris Corbyn wrote:BrandonMUS wrote:In Swift3 there was a way to add multiple connections to an instance of Swift. This way if one connection was unsuccessful you could use a backup solution. Is this possible in Swift4 or was it removed? I see that a bad connection throws an exception, so is the best way to do this to throw and catch? Or do you have a snippet for a better way?
Try/catch can work but there's two transports I still need to document:
Code: Select all
//Switches if a server fails
$mailer = new Swift_Mailer(Swift_FailoverTransport::newInstance(array(
Swift_SmtpTransport::newInstance('server1'),
Swift_SmtpTransport::newInstance('server2')
)));
//Switches after each message sent
$mailer = new Swift_Mailer(Swift_LoadBalancedTransport::newInstance(array(
Swift_SmtpTransport::newInstance('server1'),
Swift_SmtpTransport::newInstance('server2')
)));
Ahh, thank you. I really liked this feature in Swift3, so I was hoping it wasn't scrapped.
In fact, I see it in the docs now:
http://swiftmailer.org/betas/docs/v4-wo ... nents.html I guess I just overlooked that section before. Thanks!