When using IIS it is a good idea to use '\r\n' instead of '\n' when
using the mail() function.

I've also had problems with the 'From:' header in the past. This syntax
seems to work though:
$mailheaders = 'From: "A display name" <[EMAIL PROTECTED]>\r\n'

IIS seems to have real problem with that if you leave out the email
address (and just have '"Name" <>'). The foramtting above is the one
that I worked for me when wrestling with it myself and I haven't had the
will to see how much IIS will let you play with it.

HTH,
D.

> -----Original Message-----
> From: Thomas Orr [mailto:[EMAIL PROTECTED]]
> Sent: Friday, 21 December 2001 3:34 p.m.
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] email() problem
>
>
> I need help with a basic issue.  I can't seem to get the
> mail() function to
> work with php4 on an xp machine running iis5.  I'm new to php
> and really
> want to get it down, but every little thing I try to do
> throws errors at me.
> I just need to know what needs to be adjusted to get this
> script working.
> I've got a form that submits some fields to a php file that
> sends an email
> and generates a thank you message.  Thank you for any help anyone can
> provide.  This is the code:
> <?php
> $msg = "Sender Name:\t$fname $lname\n";
> $msg .= "Sender E-Mail:\t$email\n";
> $msg .= "Message:\t$street\n\n";
>
> $recipient = "[EMAIL PROTECTED]";
> $subject = "Intake Form";
>
> $mailheaders = "From: My Web Site <> \n";
> $mailheaders .= "Reply-To: $email\n\n";
>
> mail($recipient, $subject, $msg, $mailheaders);
> <------*THIS IS WHERE
> IT SCREWS UP*
>
> echo "<html><HEAD><TITLE>Information Sent!</TITLE></HEAD><BODY>";
> echo "<H1 align=center>Thank You, $fname $lname</H1>";
> echo "<P align=center>Your information has been sent.</P>";
> echo "</BODY></HTML>";
> ?>
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
>


-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to