Twitter
LinkedIn
YouTube
RSS
Facebook
ClickBank1

phpmailer and IIS SMTP Doesn’t Work

VN:F [1.9.3_1094]
Rate This Post..
Rating: 8.0/10 (1 vote cast)

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.

VN:F [1.9.3_1094]
Rate This Post..
Rating: 8.0/10 (1 vote cast)
phpmailer and IIS SMTP Doesn't Work, 8.0 out of 10 based on 1 rating

No related posts.


One Response to “phpmailer and IIS SMTP Doesn’t Work”

  1. Squiddux says:

    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!

    VA:F [1.9.3_1094]
    Rating: 0.0/5 (0 votes cast)

Leave a Reply

Spam Protection by WP-SpamFree