Hi,
We are running PHP through IIS 6 on a Windows 2003 server, we have recently closed anonymous access to close an open relay, we've then found out that you need to authenticate your php emails in order for them to send.
now i've setup phpmailer as follows:
<CODE>
require("class.phpmailer.p
hp");
$mail = new PHPMailer();
$message = $this->body;
$mail->IsSMTP();
$mail->Host = "<REMOVED>";
$mail->SMTPAuth = true;
$mail->Username = "<REMOVED>";
$mail->Password = "<REMOVED>";
$mail->From = "website@website.com";
$mail->FromName = "";
$mail->AddAddress("Address
of Client","");
$mail->AddAddress("");
$mail->AddCC("");
$mail->AddReplyTo("","");
$mail->WordWrap = 10000;
$mail->AddAttachment("");
$mail->AddAttachment("");
$mail->IsHTML(true);
$mail->Subject = "Website Reply";
$mail->Body = "$message";
$mail->AltBody = "";
if(!$mail->Send())
{
echo "Message was not sent <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
echo "</br></br></br></br><div align=\"center\"><strong>T
hankyou for submitting an Enquiry to <REMOVED></br>Your enquiry has been passed on to one of our consultants </br> Who will contact you shortly. </br></br> <REMOVED></strong></div><d
iv align=\"center\"></br><for
m name=\"form1\" method=\"post\" action=\"thanks.html\"><in
put type=\"submit\" name=\"Submit\" value=\"Back to Riversdale Mortgage Services\"></form></div><S
CRIPT LANGUAGE=\"JavaScript\">wi
ndow.locat
ion=\"than
ks.html\"<
/script>";
}
</CODE>
$message variable in the body line is equal to a hidden field located on the form page which is then posted into the email.
i am pulling in all the data from a div class located around the whole form,
<div id="emaildata">
FORM CONTENT
</div>
I seemed to have stopped the authenticated error message that was being displayed but,
Now when i try to submit the form i get the following error:
Message was not sent.
Mailer Error: Language string failed to load: recipients_failed,
but i've copied the class.phpmailer.php & class.smtp.php & the lang_en.php to the c:\php\include folder.
i've somehow been able to get it working but every 2 out of 5 emails or so will come out blank? the rest seem to work fine.
i'm pretty sure its not the code, but rather something i havn't setup up in IIS or PHP ?
Some help would be greatly appreciated.
Ian
Start Free Trial