unknown badresponseexception error?
Posted: Wed Jun 20, 2007 5:19 pm
Hello all,
I tried using swiftmailer on my server.
I created an email account ("mailer@mydomain.com") and the smtp address is mail.mydomain.com.
I created the following php file which grabs the variables from a flash site and (supposedly) sents them through email
to the email address i coded.
However when i try to run it, it gives me the following error :
The php file is the following :
What am i doing wrong? I cant really tell the error. It might be that its clost to 1:30 am here and i am almost asleep but who knows? 
thanks in advance for any help.
George
I tried using swiftmailer on my server.
I created an email account ("mailer@mydomain.com") and the smtp address is mail.mydomain.com.
I created the following php file which grabs the variables from a flash site and (supposedly) sents them through email
to the email address i coded.
However when i try to run it, it gives me the following error :
Code: Select all
Fatal error:
Uncaught Error of type [swift_badresponseexception] with message [Expected response code(s) [250] but got response []]
@0 swift::send() in /home/user/public_html/mydomain/scripts/mail.php on line 37
@1 swift::reset() in /home/user/public_html/mydomain/swift/Swift.php on line 465
@2 swift::command() in /home/user/public_html/mydomain/swift/Swift.php on line 361
in /home/user/public_html/mydomain/swift/Swift/Errors.php on line 99Code: Select all
<?php
$Name = $_POST["Name"];
$Email = $_POST["Email"];
$Subject = $_POST["Subject"];
$Message = $_POST["Message"];
$ToEmail = "mymail@gmail.com";
$EmailBody = "Όνομα/name: ".$Name."\nE-mail: ".$Email."\nΘέμα/Subject: ".$Subject."\nΜύνημα/Message: ".$Message;
$EmailFooter="\n\n\nThis message was sent through the website contact form";
$Message = $EmailBody.$EmailFooter;
//Load in the files we'll need
require_once "../swift/Swift.php";
require_once "../swift/Swift/Connection/SMTP.php";
//Start Swift
$conn =& new Swift_Connection_SMTP("mail.mydomain.com");
$conn->setUsername("user@mydomain.com");
$conn->setPassword("password");
$swift =& new Swift($conn);
//Create the message
$message =& new Swift_Message($ToSubject, $Message);
//Now check if Swift actually sends it
if ($swift->send($message, "mymail@gmail.com", "mymail@gmail.com")) $something="0";
else $something="1";
?>thanks in advance for any help.
George