After successfully sending email from my server using smtp mail option of swift mail
i was trying to send an email using a remote smtp server;
but I got the following error.
Code
****
require_once "lib/Swift.php";
require_once "lib/Swift/Connection/SMTP.php";
require_once "lib/Swift/Authenticator/LOGIN.php";
$conn =& new Swift_Connection_SMTP("mail.myremoteserver.com",25);
$conn->setUsername("xxx@myremoteserver.com");
$conn->setPassword("***");
$conn->attachAuthenticator(new Swift_Authenticator_LOGIN());
$swift =& new Swift($conn);
$message =& new Swift_Message("My subject", "My body");
//Now check if Swift actually sends it
if ($swift->send($message, "recepient@someserver.com", "xxx@myremoteserver.com")) echo "Sent";
else echo "Failed";
Error
****
Fatal error:
Uncaught Error of type [swift_connectionexception] with message [The SMTP connection failed to start [mail.myremoteserver.com:25]: fsockopen returned Error Number 110 and Error String 'Connection timed out']
@0 swift::swift() in /home/<MY SERVER PATH>/Swift/test.php on line 42
@1 swift::connect() in /home/<MY SERVER PATH>/Swift/lib/Swift.php on line 112
in /home/<MY SERVER PATH>/Swift/lib/Swift/Errors.php on line 99
can anyone help me?
Error in remote SMTP mailing
Moderators: Chris Corbyn, General Moderators
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: Error in remote SMTP mailing
The connection is timing out. This is usually down to firewall rules.
Re: Error in remote SMTP mailing
Thanx for the reply.
Could you please tell where to modify and what to modify in the firewall rules.
Could you please tell where to modify and what to modify in the firewall rules.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: Error in remote SMTP mailing
Afraid not... it's not a code-level problem, it's system-level.robinp wrote:Thanx for the reply.
Could you please tell where to modify and what to modify in the firewall rules.
If this is a shared hosting account, contact your ISP who are hosting the server for you. If you're maintaining the server, double-check that you're connecting to the correct SMTP server since the firewall rules might be on the SMTP server rather than the HTTP server.
Re: Error in remote SMTP mailing
Hi Chris,
Thanks for the soln.
I will contact the host and check the same.
Robin
Thanks for the soln.
I will contact the host and check the same.
Robin