SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Addict crabby80's Avatar
    Join Date
    May 2007
    Posts
    387
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Language string failed to load: instantiate

    Hi Guys

    Anybody had this error with phpmailer

    "Language string failed to load: instantiate"

    I have no idea what to do

    Any help would be much appreciated

    Cheers

  2. #2
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,804
    Mentioned
    157 Post(s)
    Tagged
    3 Thread(s)
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  3. #3
    rajug.replace('Raju Gautam'); bronze trophy Raju Gautam's Avatar
    Join Date
    Oct 2006
    Location
    Kathmandu, Nepal
    Posts
    4,013
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I had found this page while previously search for my problem but i did not use PHP mailer later:
    Many people are experiencing errors with the PHPMailer class but they are extremely difficult to track down because its language files aren't properly included. No proper error messages are printed from PHPMailer because of this.

    A sample error is:
    "Mailer Error: Language string failed to load: instantiate"

    The reason is because while class.phplistmailer is instantiated in /admin, its parent class (class.phpmailer) is instantiated in /admin/phpmailer, so PHPMailer ends up looking for its language files in /admin/language, which of course does not exist.

    This is a VERY trivial fix. Simply add the following to line 24 of /admin/class.phplistmailer.php:

    parent::SetLanguage('en','phpmailer/language/');

    By passing in that optional second parameter, we allow PHPMailer to finds its language files, which is ABOSULUTELY VITAL to tracking down and solving problems with sending mail.

    I have made this change and tested it on my own 2.10.2 install and it works great. I can now see the errors PHPMailer is encountering. I don't have the time to get a CVS account, but can someone patch and test this and please check it in if it works for you! Thanks.
    Mistakes are proof that you are trying.....
    ------------------------------------------------------------------------
    PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5

  4. #4
    SitePoint Addict crabby80's Avatar
    Join Date
    May 2007
    Posts
    387
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi guys

    Thanks for your responses, I also found these solutions but none seem to work?

    Question: If I enable SMTP on IIS can phpmailer use this to send mail?

    Thanks again

  5. #5
    SitePoint Addict crabby80's Avatar
    Join Date
    May 2007
    Posts
    387
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is very strange, I've tested my mail server with the mail() function and it seems to be ok and the phpmailer script works fine from another site I have hosted on the same server????

  6. #6
    SitePoint Addict crabby80's Avatar
    Join Date
    May 2007
    Posts
    387
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Problem solved

    Although I'm still quite confused as to what exactly was causing the error???

    I changed the recipient email address to my own and the class seems to work fine!! So I thought maybe the original recipient email was duff, but, I tested and it seemed to work??

    The original recipient email was a distribution list would this have caused the problem???

    Any way, I now use the original email and my own as the recipients and this seems to do the trick!!

    This was the line causing the error.

    function MailSend($header, $body) {
    $to = "";
    for($i = 0; $i < count($this->to); $i++)
    {
    if($i != 0) { $to .= ", "; }
    $to .= $this->to[$i][0];
    }

    if ($this->Sender != "" && strlen(ini_get("safe_mode"))< 1)
    {
    $old_from = ini_get("sendmail_from");
    ini_set("sendmail_from", $this->Sender);
    $params = sprintf("-oi -f &#37;s", $this->Sender);
    $rt = @mail($to, $this->EncodeHeader($this->Subject), $body,
    $header, $params);
    }
    else
    $rt = @mail($to, $this->EncodeHeader($this->Subject), $body, $header);

    if (isset($old_from))
    ini_set("sendmail_from", $old_from);

    if(!$rt)
    {
    $this->SetError($this->Lang("instantiate"));
    return false;
    }

    return true;
    }

    I hope this helps anybody who has the same problem

    Regards

    Crabby


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •