Page 1 of 1

Swift Authentication Error

Posted: Mon Aug 13, 2007 9:41 am
by evilernie
Hello, this is the error that I am getting from using the script below and I have tested the username and password for the mail server in mail.app on the mac i am using and it works. I don't know why it isn't working through the server.

Code: Select all

Fatal error: Uncaught exception 'Swift_Connection_Exception' with message 'Authentication failed using username 'comments' and password '**********'' in /var/www/aamr/swift/Swift/Connection/SMTP.php:374
 Stack trace: #0 /var/www/aamr/swift/Swift/Connection/SMTP.php(315): Swift_Connection_SMTP->runAuthenticators('comments', '**********', Object(Swift)) #1 /var/www/aamr/swift/Swift.php(272): Swift_Connection_SMTP->postConnect(Object(Swift)) #2 /var/www/aamr/swift/Swift.php(229): Swift->handshake(Object(Swift_Events_ResponseEvent)) #3 /var/www/aamr/swift/Swift.php(102): Swift->connect() #4 /var/www/aamr/comments_process.php(84): Swift->__construct(Object(Swift_Connection_SMTP)) #5 {main} thrown in /var/www/aamr/swift/Swift/Connection/SMTP.php on line 374

Code: Select all

$uri = $_POST["uri"];
$name = stripslashes($_POST["commentor_name"]);
$email = $_POST["commentor_email"];
$ipadd = $_POST["domain"];
$scriptname = $_POST["scriptname"];
$main_id = $_POST["main_id"];
$pic_id = $_POST["pic_id"];
$vid_id = $_POST["vid_id"];

require_once "/var/www/aamr/swift/Swift.php";
require_once "/var/www/aamr/swift/Swift/Connection/SMTP.php";

$swiftb =& new Swift(new Swift_Connection_SMTP("artintheage.com"));

//Create the sender from the details we've been given
$senderb =& new Swift_Address($email, $name);

//Create the message to send
$messageb =& new Swift_Message("AAMR Comment");
$messageb->attach(new Swift_Message_Part($bodyb));

//Try sending the email
$sentb = $swiftb->batchsend($messageb, "email1", "email2");

//Disconnect from SMTP, we're done
$swiftb->disconnect();