Hi Guys,
Hope you can help me with this little conundrum I'm having currently.
My company has a dedicated windows server with heart internet and for means of database interaction, we've been forced to move one of our php sites to there. Everythings great and works fine - except the mail function.
The SMTP server is hooked up using MailEnable - I'm absolutely clueless on how windows servers work so forgive me for sounding silly asking this question.
The problem I'm having has been constant across everything I try - I get authentication errors. The latest attempt gives the most information - PHPmailer:
SMTP -> FROM SERVER: 220 mail12.extendcp.co.uk ESMTP Exim Fri, 09 Dec 2011 23:12:50 +0000 SMTP -> FROM SERVER: 250 mail12.extendcp.co.uk Hello ds-xxxxx.ds-x.com [95.131.68.91] SMTP -> ERROR: AUTH not accepted from server: 503 AUTH command used when not advertised Mailer Error: SMTP Error: Could not authenticate
The script which ouputs this is as follows:
(emails and server names changed)
require("func/class.mailer.php");
$mail = new PHPMailer();
$mail->IsSMTP(); // telling the class to use SMTP
$mail->SMTPDebug = 2; // enables SMTP debug information (for testing)
// 1 = errors and messages
// 2 = messages only
$mail->SMTPAuth = true; // enable SMTP authentication
// $mail->SMTPSecure = "TLS";
$mail->Host = "mail.smtp.co.uk"; // sets the SMTP server
$mail->Port = 587; // set the SMTP port for the GMAIL server
$mail->Username = "mail@smtp.co.uk"; // SMTP account username
$mail->Password = "xxxxx"; // SMTP account password
//$mail->SetFrom('name@yourdomain.com', 'First Last');
$mail->AddReplyTo("name@yourdomain.com","First Last");
$mail->Subject = "PHPMailer Test Subject via smtp, basic with authentication";
$address = "tom@test.co.uk";
$mail->AddAddress($address, "John Doe");
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message sent!";
}
That's taken from an example on the phpmailer site. I'm certain I've got the correct class files (as for some reason I downloaded the wrong ones from their site earlier!)
I'm also aware of the odd port number, that's what heart recommended.
Can anyone recommend and advise? I've tried everything to get this working and I'm all out of ideas - plus I'm a complete n00b as stated earlier.
Thanks,
Tom