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

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

Posted on 2007-04-10
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
  • 4
  • 2
LVL 48

Accepted Solution

hernst42 earned 500 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?
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.


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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.

789 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