Page 1 of 1

Mails not sent

Posted: Mon Jun 09, 2008 8:45 am
by kkonline

Code: Select all

 
<?php
 
//Load in the files we'll need
require_once "lib/Swift.php";
require_once "lib/Swift/Connection/SMTP.php";
 
//Start Swift
$swift =& new Swift(new Swift_Connection_SMTP("smtp.your-host.tld"));
 
//Create the message
$message =& new Swift_Message("My subject", "My body");
 
//Now check if Swift actually sends it
if ($swift->send($message, "foo@bar.tld", "me@mydomain.com")) echo "Sent";
else echo "Failed";
 ?>
this is the mail i am using
however i receive the following errors and the mail is not delivered. Can someone suggest something


Fatal error: Uncaught exception 'Swift_ConnectionException' with message 'The SMTP connection failed to start [server.tld:25]: fsockopen returned Error Number 100 and Error String ''' in /home/mysite/public_html/addons/swiftmailer/lib/Swift/Connection/SMTP.php:309 Stack trace: #0 /home/mysite/public_html/addons/swiftmailer/lib/Swift.php(216): Swift_Connection_SMTP->start() #1 /home/mysite/public_html/addons/swiftmailer/lib/Swift.php(101): Swift->connect() #2 /home/mysite/public_html/addons/swiftmailer/simple.php(6): Swift->__construct(Object(Swift_Connection_SMTP)) #3 {main} thrown in /home/mysite/public_html/addons/swiftmailer/lib/Swift/Connection/SMTP.php on line 309

Re: Mails not sent

Posted: Mon Jun 09, 2008 10:21 pm
by Chris Corbyn
Are you connecting to the correct SMTP server? Is there maybe a firewall rule in place blocking the attempt?