Mailer Error: Language string failed to load: instantiate

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
shanthini
Forum Newbie
Posts: 12
Joined: Wed Jun 18, 2008 11:22 pm

Mailer Error: Language string failed to load: instantiate

Post by shanthini »

We are using php on linux server . When trying to send mail using phpmailer the following error occurs. Can anyone help me in solving this.

“Mailer Error: Language string failed to load: instantiate”

We used the following code and here details like username and password are fetched from table called ‘global’.

<?php

include("include/DBConnection.php");


require("include/class.phpmailer.php");



$headers = "MIME-Version: 1.0\n" .
"Content-Type: text/html; charset=\"iso-8859-1\"\n" .
" boundary=\"{$mime_boundary}\"";
$headers.= "From: from@test.com \r\n";

$mail = new PHPMailer();
$mail->IsMail();

$sel_global=mysql_query("select go_sa_uname,go_ip,go_port,go_serveruid,go_serverpwd,go_email,go_mail_headmsg,go_mail_footmsg,go_paymentslip from global");
if(mysql_num_rows($sel_global)>0)
{
$mail_id=mysql_fetch_object($sel_global);
$admin_name=ucfirst($mail_id->go_sa_uname);
$headmsg=$mail_id->go_mail_headmsg;
$footmsg=$mail_id->go_mail_footmsg;
$FromEmailId=$mail_id->go_email;
$host=$mail_id->go_ip;
$port=$mail_id->go_port;
$username=$mail_id->go_serveruid;
$password=$mail_id->go_serverpwd;
}

$mail->Host=$host;
$mail->SMTP_PORT=$port;
$mail->SMTPAuth= true;
$mail->Username=$username;
$mail->Password=$password;
$mail->FromName="From Name";
$mail->From=”specified from id here”;

$mail->IsHTML(true);
$mail->Subject="Testing";

$mail->Body ="Testing mail function";

$mail->AddAddress("specified to id here ");

if($mail->Send())
echo "Mail Sent Successfully";
else
echo "Mailer Error: " . $mail->ErrorInfo ."<br>";




?>
Post Reply