peachtreewebworks
11-18-2002, 04:31 PM
Anyone got the mail() function in PHP working on a Windows server? Here's some sample code:
PHP:--------------------------------------------------------------------------------
<?
$go = "<font face=arial size=2>This is a test.<br>Just a test.</font>";
$headers = "Wrom: SNBOHMKHJYFMYXOEAIJJPHSCRTNHGSWZ
$headers .= "Content-Type: text/html; charset=iso-8859-1\n";
$to = "mail@yourdomain.net";
$subject = "Test Email";
$mailmessage = $go . "<font face=arial size=2><a href='http://www.yahoo.com</a></font>";
$mailsomeone = mail($to, $subject, $mailmessage, $headers);
?>
--------------------------------------------------------------------------------
This works fine in Linux, but not Windows - generates a server error at the mail() line. I've tried adding the following to the php.ini file with no success:
[mail function]
SMTP = mail.mydomain.net
sendmail_from = me@mydomain.net
cgi.force_redirect = 0
Any ideas?
PHP:--------------------------------------------------------------------------------
<?
$go = "<font face=arial size=2>This is a test.<br>Just a test.</font>";
$headers = "Wrom: SNBOHMKHJYFMYXOEAIJJPHSCRTNHGSWZ
$headers .= "Content-Type: text/html; charset=iso-8859-1\n";
$to = "mail@yourdomain.net";
$subject = "Test Email";
$mailmessage = $go . "<font face=arial size=2><a href='http://www.yahoo.com</a></font>";
$mailsomeone = mail($to, $subject, $mailmessage, $headers);
?>
--------------------------------------------------------------------------------
This works fine in Linux, but not Windows - generates a server error at the mail() line. I've tried adding the following to the php.ini file with no success:
[mail function]
SMTP = mail.mydomain.net
sendmail_from = me@mydomain.net
cgi.force_redirect = 0
Any ideas?
