|
Posted by Loki25 on 08/07/07 02:19
On Aug 6, 11:15 pm, alice <al...@fearofdolls.com> wrote:
> On Aug 6, 7:03 pm, Geoff Muldoon <geoff.muld...@trap.gmail.com> wrote:
>
>
>
> > alice says...
>
> > > Can anyone tell me why this code won't work?
> > > I've saved it as mail.php, and have a form on a web page with
> > > action="mail.php" in the html. I've gotten this to work before on
> > > other pages I've worked on, I can't figure out why it's not working
> > > today, I must have forgotten something. The thank you page comes up,
> > > but the mail is not actually delivered.
>
> > > <?php
> > > $to="g...@fearofdolls.com";
> > > $subject="Fear of Dolls web email";
> > > $email=$_POST["email"];
>
> > > $message="From Fear of Dolls web email\n";
> > > $message.="message: ".$message."\n";
>
> > > $head="From: f...@fearofdolls.com";
> > > mail($to,$subject,"".$message,$head);
>
> > ^^^^
> > dot not comma?
>
> > > header("Location:thankyou.html");
> > > ?>- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> > - Show quoted text -
>
> So it should be mail($to,$subject,"",$message,$head);
> ?
No
The signature of PHP's mail function is:
bool mail ( string $to, string $subject, string $message [, string
$additional_headers [, string $additional_parameters]] )
meaning that if you use: mail($to,$subject,"",$message,$head) then
what will happen is PHP will consider $message to be your headers and
if it does work, it will just send a blank email because you are
passing "" as the message
I'd recommend you use mail($to,$subject,$message,$head); instead
Navigation:
[Reply to this message]
|