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:(
fatal error....
Moderators: Chris Corbyn, General Moderators
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: fatal error....
The connection is timing out. It sounds like there's a firewall that's blocking the connection.
-
BrandonMUS
- Forum Newbie
- Posts: 15
- Joined: Mon Nov 10, 2008 9:45 am
Re: fatal error....
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....
Solution: staff change default SMTP port to 26 and now works
.. const PORT_DEFAULT = 26; ...
.. const PORT_DEFAULT = 26; ...
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: fatal error....
Try/catch can work but there's two transports I still need to document: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?
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')
)));- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: fatal error....
Good to hearmatic07 wrote:Solution: staff change default SMTP port to 26 and now works![]()
.. const PORT_DEFAULT = 26; ...
-
BrandonMUS
- Forum Newbie
- Posts: 15
- Joined: Mon Nov 10, 2008 9:45 am
Re: fatal error....
Ahh, thank you. I really liked this feature in Swift3, so I was hoping it wasn't scrapped.Chris Corbyn wrote:Try/catch can work but there's two transports I still need to document: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?
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') )));
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!