phpmailer and IIS SMTP Doesn’t Work
After much messing around, I was still unable to get phpmailer to work on IIS6 (Windows 2003). I am using PHP v5.x for windows.
From investigation it seems that IIS SMTP service has a problem with phpmailer. The error message from PHP is:-
“Language string failed to load: instantiate”
What this actually means is that IIS SMTP service is throwing a wobbly and can’t cope with adding the senders name in the header.
phpmailer can be “hacked” to work with IIS by removing the senders header. See here for more information.
Another alternative that I found is to install a decent SMTP service. MailEnable (Free) solved the problem for me. I guess it’s more tolerant of standards than IIS SMTP.
No related posts.






I was able to get this to work using php 5.x, MS Server 2003, SMTP Server on IIS6, and PHPMailer.
Followed these intructions for SMTP Server: http://www.ruhanirabin.com/php-sendmail-setup-with-smtp-iis-and-windows-servers/
And used this php code:
require_once("phpmailer/class.phpmailer.php");
$mail = new PHPMailer();
$body = "Message here...";
$mail->IsSMTP();
$mail->Host = "localhost:25";
$mail->SetFrom('sender@domain.com', 'From Name');
$mail->Subject = "The subject";
$mail->AltBody = "No HTML? - optional message";
$mail->MsgHTML($body);
$mail->AddAddress('recipient@domain.com', "To Name");
if(!$mail->Send()) {
$response = "Mail failed to send.";
} else {
$response = "Mail delivered.";
}
$mail->ClearAddresses();
return $response; // echo $response
Hope it helps! Great site, thanks!