SMTP authentication error
Posted: Thu Sep 20, 2007 5:02 pm
I have just started receiving an error message using PowWeb's e-mail servers (which I didn't receive a few days ago, and which I don't receive using Dreamhost's e-mail servers). Sample code:
(Obviously, "mail.myserver.tld" and the user name/password are filled in with the appropriate data)
The error message:
I'd greatly appreciate any help!
Code: Select all
//Load in the files we'll need
require_once "lib/swift/Swift.php";
require_once "lib/swift/Swift/Connection/SMTP.php";
require_once "lib/swift/Swift/Authenticator/LOGIN.php";
//Start Swift
$conn =& new Swift_Connection_SMTP("mail.myserver.tld", 25);
$conn->setUsername("myusername");
$conn->setPassword("mypassword");
$conn->attachAuthenticator(new Swift_Authenticator_LOGIN());
$swift =& new Swift($conn);
//Create the message
$message =& new Swift_Message("My subject", "My body");
//Now check if Swift actually sends it
if ($swift->send($message, "to@address.tld", "from@addres.tld")) echo "Sent";
else echo "Failed";The error message:
I've tried using CRAM-MD5 (which doesn't work at all) and PLAIN, too (same result as with LOGIN). I assume that PowWeb have changed something at their end, but getting reliable information out of them isn't always easy; is this error regularly run into and is there a general solution?PHP Fatal error:
Uncaught Error of type [swift_connection_exception] with message [Authentication failed using username 'myusername' and password '**********']
@0 swift::swift() in /path/to/swifttest.php on line 14
@1 swift::connect() in /path/to/lib/swift/Swift.php on line 111
@2 swift::handshake() in /path/to/lib/swift/Swift.php on line 245
in /path/to/lib/swift/Swift/Errors.php on line 99
I'd greatly appreciate any help!