I’ve just spent some time figuring our an issue I’ve had with PHPLinkDirectory running on IIS. I’m building a new directory site for SearchMann and decided to use an off-the-shelf package for doing this. The biggest problem I’m finding is that the majority of phpLD’s user base run the package on Apache where PHP runs better than on IIS. It’s not the language itself that’s the problem, more the capabilities of the platform. My biggest bug bear so far is the fact that there’s no equivalent of mod_rewrite on IIS, but that’s another story …
Anyway, the problem started when I tried sending email and started getting the following cryptic message:
Language string failed to load: instantiate
I spent some time trying to figure out why it wasn’t picking up the correct language file but then decided I should really be looking at the source of the problem. What was the error message it was trying to report?
Turns out the problem lay in the actual mail component not managing to send out email and trying to report an initialisation problem. I turned my attention to this and spent a substantial amount of time trying to figure out why.
Eventually the penny dropped! I had already come across this problem in the past while sending email from PHP. This is caused by the way the windows mail server interprets the headers being sent to it. The solution was simple (once you figure it out), and involves removing the “<” section that adds the sender name so that your mail program can describe the email address is receives.
So I found this code:
/**
* Formats an address correctly.
* @access private
* @return string
*/
function AddrFormat($addr) {
if(empty($addr[1]))
$formatted = $addr[0];
else
{
$formatted = $this->EncodeHeader($addr[1], ‘phrase’) . ” <” .
$addr[0] . “>”;
}return $formatted;
}
and replaced it with:
/**
* Formats an address correctly.
* @access private
* @return string
*/
function AddrFormat($addr) {$formatted = $addr[0];
return $formatted;
}
and voila’. Problem solved!
Just a quite note that this solution effectively changes the mail header to omit the senders name. I suspect this is due to my hosting provider’s configuration, but I’m led to believe it’s not an uncommon problem on Windows servers running php. If you run into a similar problem, I hope this post has been useful.
Best of luck!

