Hi all
please, some body help me, its too strange that im trying 3 days to send an email but i cant. I use phpmailer and recieve this Mailer Error: Language string failed to load: connect_host
this is my code, whats wrong?

<?php

require("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = "something";
$mail->SMTPAuth = true;
$mail->Username = "myusername";
$mail->Password = "mypassword";
$mail->From = "email1@domailname.com";
$mail->FromName = "name1";
$mail->AddAddress("email2@domainamel.com","name2");
$mail->WordWrap = 50;
$mail->IsHTML(true);
$mail->Subject = "Here is the subject";
$mail->Body = "this is testttttttt";
$mail->AltBody = "This is the text-only body";
if(!$mail->Send())
{
echo "Message was not sent <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
?>

    If your include_path setting is not set up to point to the PHPMailer directory, then you will have to explicitly include the language file into your script. It will be something like:
    <path to PHPMailer directory>/language/phpmailer.lang-en.php (or whichever other language file you want to use)

      NogDog wrote:

      If your include_path setting is not set up to point to the PHPMailer directory, then you will have to explicitly include the language file into your script. It will be something like:
      <path to PHPMailer directory>/language/phpmailer.lang-en.php (or whichever other language file you want to use)

      Thank you so much. i did it

        20 days later

        Hello,
        I'm having the same problem, but I don't understand, where do I place the directory to the language file. Do I have to if the PHP file is in the same folder as the language file?

          2 years later

          I am using PHP Mailer to send mail via Gmail.

          Sometimes I see "Language string failed to load: connect_host" error. This error is caused by Gmail and it's not a PHP Mailer problem.

            Write a Reply...