PHP MAIL on Apache and Windows Server 2003



I am at my wits end here, I am trying to get PHP's mail function send
mail correctly but no matter what I do it doesn't seem to work.

We can send mail from an email client on the server just fine, and the
relay and usage persmissions are all correct.

We are running the SMTP sever under Windows and are running PHP
through Apache the PHP.ini file is setup as follows:

[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 110

; For Win32 only.
sendmail_from = admin@ouremailaddress

-----------------------------------------------------------------

Port 110 is correct for our SMTP server, and the firewall is properly
configured but from some reason mail never gets sent, and it's not
being caught by the spam filter or anything like that.

I'm using this bit of code to test it:

<?PHP

// ---------------- SEND MAIL FORM ----------------

// send e-mail to ...
$to="me@ouremail";

// Your subject
$subject="Test";

// From
$header="from: my name <myemail>";

// Your message
$message="Hello \r\n";
$message.="This is test\r\n";
$message.="Test again ";

// send email
$sentmail = mail($to,$subject,$message,$header);

// if your email succesfully sent
if($sentmail){
echo "Email Has Been Sent .";
}
else {
echo "Cannot Send Email ";
}

?>
---------------------------------------------------------------------------------------

It seems to work correctly showing me that the mail has been sent, but
nothing happens.

Any help would be appreciated.

.



Relevant Pages

  • Re: PHP Mail
    ... ; For Win32 only. ... SMTP = localhost ... do you have the smtp server installed or are you running exchange? ...
    (microsoft.public.inetserver.iis.smtp_nntp)
  • Re: PHP SMTP SERVICE
    ... php.ini file, search for SMTP. ... ; For Win32 only. ... change the word localhost to your desired SMTP server address. ...
    (php.general)
  • Error using mail() - sendmail_from not set in php.ini or custom From: missing
    ... ; For Win32 only. ... SMTP = localhost ...
    (comp.lang.php)
  • PHP Mail
    ... ; For Win32 only. ... SMTP = localhost ...
    (microsoft.public.inetserver.iis.smtp_nntp)
  • false positive
    ... I've used php mail function to send e-mail to students. ... So I'm trying to use Phpmailer, a software able to work as an SMTP ... Risposta del Tutor on Line ...
    (comp.mail.headers)