RE: [PHP-WIN] email() problem
| From: | Daniel Parsons | Date: | Fri, 21 Dec 2001 03:36:51 +0000 |
| Subject: | RE: [PHP-WIN] email() problem | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-11051@lists.php.net to get a copy of this message | ||
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" <mail@mysite.com>\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:redijediknight@netzero.net]
> Sent: Friday, 21 December 2001 3:34 p.m.
> To: php-windows@lists.php.net
> 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 = "me@myaddress.com";
> $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: php-windows-unsubscribe@lists.php.net
> For additional commands, e-mail: php-windows-help@lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
>