help with mail() function
Posted: Wed Dec 25, 2002 4:15 pm
Hi guys,
I'm new to PHP (but have been doing much research) and have been experiencing a problem with the mail() function. When I run the following simple code on my "localhost" computer, there is no problem. But when I run it on a hosted server (windows 2000), it gives me a "server error" message. I spoke to tech support at the hosting company and he tells me its a code problem and that all windows servers are different. I know they run php and allow us to use the mail() function. I don't understand what the problem is.
<?
$to = "myemailaddress@domain.com";
$subject = "testing PHP mail";
$msg = "test";
mail("$to", "$subject", "$msg");
echo "finished!";
?>
Thanks in advance,
Jon
I'm new to PHP (but have been doing much research) and have been experiencing a problem with the mail() function. When I run the following simple code on my "localhost" computer, there is no problem. But when I run it on a hosted server (windows 2000), it gives me a "server error" message. I spoke to tech support at the hosting company and he tells me its a code problem and that all windows servers are different. I know they run php and allow us to use the mail() function. I don't understand what the problem is.
<?
$to = "myemailaddress@domain.com";
$subject = "testing PHP mail";
$msg = "test";
mail("$to", "$subject", "$msg");
echo "finished!";
?>
Thanks in advance,
Jon