Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


phpmailer.php on Windows platform giving error (fine on unix)- how do I fix?

Posted on 2007-04-10
Medium Priority
Last Modified: 2013-12-13
Hi there,

I was testing a php driven website on a Linux platform and all was great. the script made use of the phpmailer.php class which I've used in a few projects.

In this case the code needed to be ported to a Windows hosting environemen and on any page that calls the phpmailer script I get the following error:

There has been an email error
The error was:
Language string failed to load: instantiate
There has been an email error
The error was:
Language string failed to load: instantiate

The error is printed twice at the top of the page. does anyone know how to fix this.
Not being familar with windows hosting that much I've not tried anything yet. Hopefully so,ethign simple like changing a path.
Question by:afflik1923
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
LVL 48

Accepted Solution

hernst42 earned 2000 total points
ID: 18884150
The pathes might be a little bit different on windows than on yourl inux, did you made a call to
$mailer->SetLanguage('en', '/path/to/the/langauge/dir/of/your/phpmailer/');
This error message comes if no language files could be included correctly.

Author Comment

ID: 18886659
Ok yes, this seems to be the problem as looking through the code I find reference to a call to SetLangauge.

but what value should I be using as a path? How do I know where the language settings are?

Forgive me if this is stupid question and I will keep looking into this but if you do know off hand then great.
LVL 48

Expert Comment

ID: 18887795
the language-files are in the language directory. The path can either be absolute or relative to your current executed script. THe language directory comes with phpmailer. Maybe that directory is missing in your application?
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 18888409
Well that is strange. I have used the script many times on Linux boxes and all I have ever done is use a single script called
class.phpmailer.php and it never has been a problem. It was a log time ago that I originally downloaded it and having just downloiaded it agqain from source forge I see there are many files associated with it.

There is even the option to download both a unix and windows version. Maybe I hve just been very stupid here.

I will investigate further and report back.

Author Comment

ID: 18888745
Not havin much luck on the windows server. Not that familar with using Windows hosting
I now get the error:

Could not instantiate mail function.
I pust the language folders on the server.
It was all so easy on Linux

Author Comment

ID: 18888948
Problem resolved.

The hosts did not allow sending of email from domains other then those parked (An anti spam measure I assume).

Bit annoying actually but heopfully should be as simple as parking the required domains (even if the name servers are not changed for those domains)

thanks again.

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question