tags:

views:

380

answers:

1
function register_contact ($person = array()) {
 $nogood = false;
 foreach ($person as $val) {
  if (strlen($val)==0) {
   $nogood = true;
   $status = "There was an error sending the registration please fill in all fields";
  }
 }
 if (!$nogood) {
  require_once("class.phpmailer.php");

  $message = "New request for Fox In Touch Recipient:.\r\n\r\n";
  $message .= "Forename: " . $person['fname'];
  $message .= "\r\nSurname: " . $person['sname'];
  $message .= "\r\nEmail: " . $person['email'];
  $message .= "\r\nJob Title: " . $person['job'];
  $message .= "\r\nCompany: " . $person['company'];
  $message .= "\r\n\r\nFox In Touch.";

  $mail = new PHPMailer();

  $mail->IsSMTP();                                   // send via SMTP
  $mail->Host     = "ahost"; // SMTP servers
  $mail->SMTPAuth = true;     // turn on SMTP authentication
  $mail->Username = "name";  // SMTP username
  $mail->Password = "pass"; // SMTP password
  //$mail->Post = 587;

  $mail->From     = "[email protected]";
  $mail->FromName = "Fox In Touch";
  //$mail->AddAddress("[email protected]", "Fox Licensing");
  $mail->AddAddress("[email protected]", "Andrew");
  $mail->AddReplyTo("[email protected]","Information");
  $mail->IsHTML(false);                               // send as HTML

  $mail->Subject  =  "Contact request for Fox In Touch!";
  $mail->Body     =  $message;

  if(!$mail->Send()) {
   $nogood = true;
   $status = "Message was not sent <p>";
   $status .= "Mailer Error: " . $mail->ErrorInfo;
  } else {
   $status = "Thank you! Your message has been sent to 20th Century Fox. Submit another?"; 
  }
 }
 return array('email_failed'=>$nogood, 'status'=>$status);
}

The above code keeps giving me the error, "Mailer Error: Language string failed to load: [email protected]". I have tried changing the AddAddress(). The smtp connection settings are correct, as this was the last error i had! Any help would be much appreciated. Thanks

+1  A: 

It sounds like you have two problems.

1) Your language file isn't being loaded - see installation

2) The recipient is being rejected - errr double check the SMTP settings and the recipient address

Greg