How to code for "My server requires authentication"
Posted: Sat Feb 28, 2009 11:03 pm
I am sorry if this is a stupid question, but I just can't figure it out. I am trying to determine what code I need to use to perform that same function as checking the "My server requires authentication" box in Outlook when setting up an account.
Here is the code I have -
I know I have all of the **-** variables correct. But the problem I have is I keep getting this error -
I just need to perform the same function as the "My server requires authentication" box in Outlook when setting up an account.
Any help would be greatly appreciated. Thank you.
Here is the code I have -
Code: Select all
require_once "swiftmailer-library/Swift.php";
require_once "swiftmailer-library/Swift/Connection/SMTP.php";
$smtp =& new Swift_Connection_SMTP(**SMTPSERVER**, **PORT**);
$smtp->setUsername(**USERNAME**);
$smtp->setpassword(**PASSWORD**);
$swift =& new Swift($smtp);
Code: Select all
Fatal error:
Uncaught Error of type [Swift_ConnectionException] with message [Authentication failed using username '**USERNAME**' and password '*********']
@0 Swift::Swift() in admin-send-email.php on line 100
@1 Swift::connect() in /swiftmailer-library/Swift.php on line 109
@2 Swift::handshake() in /swiftmailer-library/Swift.php on line 230
Any help would be greatly appreciated. Thank you.