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 = "foxintouch@bionic-comms.co.uk";
$mail->FromName = "Fox In Touch";
//$mail->AddAddress("foxlicensing.europe@fox.com", "Fox Licensing");
$mail->AddAddress("andrew@yahoo.co.uk", "Andrew");
$mail->AddReplyTo("foxintouch@bionic-comms.co.uk","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);
}
Yukarıdaki kod bana hata veren tutar, "Mailer Hata: Dil dize yüklenemedi: recipients_failedandrew@yahoo.co.uk". Ben AddAddress () değiştirmeyi denedim. Bu ben son hata olarak smtp bağlantı ayarları, doğru! Herhangi bir yardım çok takdir. Teşekkürler