Sublime directory Surf the web anonymous Pagerank Monitor


phpmailer errors

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();

?>

Nikolas
Fri 14 March 2008, 08:24 am GMT +0100
First of all, are you sure you can send email with no password from your SMTP server?

If you can this may be caused because your server is blacklisted.

olaf
Fri 14 March 2008, 08:35 am GMT +0100
First of all, are you sure you can send email with no password from your SMTP server?

If you can this may be caused because your server is blacklisted.

I'm almost sure he need to connect first, you need to add this vars to:

$mail->SMTPAuth = true; 
$mail->Username = "mailuser";
$mail->Password = "mailpw";

Archive for SMF v1.00 by N.P. Valid XHTML 1.0 Transitional