PHPMailer error (s)

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

      

The above code keeps giving me an error: "Mailer error: language string was not loading: recipients_failedandrew@yahoo.co.uk ". I tried to change AddAddress (). The smtp connection settings are correct as this was the last error I had! Any help is appreciated. Thanks to

0


source to share


1 answer


It looks like you have two problems.

1) Your language file is not loading - see installation



2) Recipient is rejected - errr double checks SMTP parameters and recipient address

+1


source







All Articles