mail() on a MS server...help!
Posted: Mon Oct 16, 2006 6:55 pm
Hi all!
First off... This is the first time I've tried using the mail() function on a Microsoft server... It's driving me nuts! For some reason the emails aren't being sent. I keep reading that "The Windows implementation of mail() differs in many ways from the Unix implementation." and "Used under Windows only: host name or IP address of the SMTP server PHP should use for mail sent with the mail() function." However the latter isn't explained enough for my simple mind.
I've checked to see if the internal sendmail support for windows was installed... it is. And the sendmail_from is set to localhost. I assume it's my code that's causing the problem. I've got to get this working ASAP, could some kind person show me the light?
here's the basics of my code:
Any help would be appreciated!
Thanks
HG
First off... This is the first time I've tried using the mail() function on a Microsoft server... It's driving me nuts! For some reason the emails aren't being sent. I keep reading that "The Windows implementation of mail() differs in many ways from the Unix implementation." and "Used under Windows only: host name or IP address of the SMTP server PHP should use for mail sent with the mail() function." However the latter isn't explained enough for my simple mind.
I've checked to see if the internal sendmail support for windows was installed... it is. And the sendmail_from is set to localhost. I assume it's my code that's causing the problem. I've got to get this working ASAP, could some kind person show me the light?
here's the basics of my code:
Code: Select all
$to = $_REQUEST[email];
$headers .= "FROM: jill@mysite.com\r\n";
$headers .= "BCC: me@mysite.com\r\n";
$subject = "$_REQUEST[sname] has sent you a postcard!";
$message .= "Clever copy thing here...\n\n";
$message .= "Click on the link or copy and paste the following URL into your web browser to view your postcard.\n\n";
$message .= "http://www.mysite.com/postcard.php?p=$_REQUEST[uid]\n\n";
$message .= "Thank You!\n";
$message .= "Jill\n\n";
if ( !mail($to, $subject, $message, $headers) ) {
$error = "Sorry. There was a problem sending the postcard to the address provided. Please try again.";
}Thanks
HG