Error in remote SMTP mailing
Posted: Mon Mar 02, 2009 3:35 am
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?
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?