msthac01
Wed 12 March 2008, 06:43 pm GMT +0100
I'm using the phpmailer to add an attachment and mail it to the client as well as the employee. Well I can send to as many internal addresses as I want but I always get an SMTP error when trying to send to an outside address, even known good ones...Here's the error I reveive:
Mailer Error: SMTP Error: The following recipients failed:
Here's the code I'm using for everthign:
<?php
$mail = new PHPMailer();
$mail->From = $MAEmail;
$mail->FromName = $MAName;
$mail->Host = "smtp.looktoliberty.com";
$mail->Mailer = "smtp";
$mail->ContentType = "text/html";
$mail->Subject = "PreApproval Letter from ".$MAName;
// HTML body
$body = $message;
$mail->Body = $body;
$mail->AddAddress($MAEmail, $borEmail);
if($theLoanType == 174 || $theLoanType == 176)
{
$mail->AddAttachment("AmendatoryClause(Letter).pdf", "AmendatoryClause(Letter).pdf"); // optional name
}
if(!$mail->Send())
{
echo "There has been a mail error sending to " . $borEmail.", ".$MAEmail . "<br>";
echo "Mailer Error: " . $mail->ErrorInfo . "<br />";
}
else
{
echo "You have successfully sent the PreApproval letter to: ".$borEmail."";
}
// Clear all addresses and attachments for next loop
$mail->ClearAddresses();
$mail->ClearAttachments();
?>
Mailer Error: SMTP Error: The following recipients failed:
Here's the code I'm using for everthign:
<?php
$mail = new PHPMailer();
$mail->From = $MAEmail;
$mail->FromName = $MAName;
$mail->Host = "smtp.looktoliberty.com";
$mail->Mailer = "smtp";
$mail->ContentType = "text/html";
$mail->Subject = "PreApproval Letter from ".$MAName;
// HTML body
$body = $message;
$mail->Body = $body;
$mail->AddAddress($MAEmail, $borEmail);
if($theLoanType == 174 || $theLoanType == 176)
{
$mail->AddAttachment("AmendatoryClause(Letter).pdf", "AmendatoryClause(Letter).pdf"); // optional name
}
if(!$mail->Send())
{
echo "There has been a mail error sending to " . $borEmail.", ".$MAEmail . "<br>";
echo "Mailer Error: " . $mail->ErrorInfo . "<br />";
}
else
{
echo "You have successfully sent the PreApproval letter to: ".$borEmail."";
}
// Clear all addresses and attachments for next loop
$mail->ClearAddresses();
$mail->ClearAttachments();
?>