Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Sep 2002
    Location
    South East UK. 35 miles east of London, in sight of the River Thames.
    Posts
    300
    Thanks
    10
    Thanked 0 Times in 0 Posts

    PHP Mail function in Windows 2003 Server

    Hi All,

    I have PHP 5 installed on a Windows 2003 SP2 server.
    I can't send any emails.

    I have tried this simple test script:

    [CODE]
    <?php
    $to = "gary@internetpipelinesuk.com";
    $subject = "Test mail";
    $message = "Hello! This is a simple email message.";
    $from = "gary@internetpipelinesuk.com";
    $headers = "From: $from";
    mail($to,$subject,$message,$headers);
    echo "Mail Sent.";
    ?>
    [CODE]

    but all I get is "Web page cannot be displayed".

    sendmail is enabled in php.ini

    Is there a list of tests I can run to identify this problem and fix it?

    Regards

    Gary

  • #2
    120
    120 is offline
    Regular Coder
    Join Date
    Nov 2009
    Location
    UK
    Posts
    105
    Thanks
    6
    Thanked 15 Times in 15 Posts
    It's probably fair to say that W2K3 does not have sendmail, being that it's windows. I'm not sure if it uses the sendmail calls to invoke the Windows SMTP 'connector'/'process' but I *think* you need to configure an account that can send mail via SMTP on the box, and use those credentials in the php.ini file (from memory a long time ago - so busking it a bit). Is the 2k3 server running Exchange and acting as a DC at all, or just a stand alone server?

    The troubleshooting would probably begin with setting up the SMTP service (if you are not using exchange) and making sure you can sent out with it using some simple telnet or client tests to it. Get that working then try and get PHP talking to it.

    Post 13 at this link may help:
    http://www.webhostingtalk.com/showthread.php?t=452021
    Last edited by 120; 06-30-2010 at 03:31 PM.
    There is always plenty of idol work for the devils hands to do
    Registered Linux User 475075 : Project Honeypot

  • #3
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    The error "Web page cannot be displayed" suggests the issue is beyond not sending mail. It's not loading the page at all. Do any PHP pages load?
    Are you a Help Vampire?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •