Re: mail prob
| From: | W.D. | Date: | Fri, 23 Feb 2001 06:22:35 +0000 |
| Subject: | Re: mail prob | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-41271@lists.php.net to get a copy of this message | ||
<form method="POST" action="<?php print ($PHP_SELF);?>">
First Name: <input type=TEXT name="FirstName" size=15><p>
Last Name: <input type=TEXT name="LastName" size=25><p>
E-mail Address: <input type=TEXT name="Email" size=25><p>
<textarea name="Info" rows="5" cols="40" wrap=SOFT>Ask a
Question</textarea><p>
<input type=SUBMIT> <input type=RESET>
</font>
</form>
<?php
$from = $FirstName ." ". $LastName;
$subject = $Email;
$message = $Info;
mail("webmaster@domain.com, info@domain.com, $subject, $message, $from);
?>
> From: "W.D." <suedeuno@yahoo.com>
>
> > well this is actually what I did tho, I used an $email var and set it
too
> > $from which I used mail()....and it still came out as nobody
> >
>
>
> Can you show us the PHP code you're using please.
>
> Ta
>
>
>
>
>
> > > From: "W.D." <suedeuno@yahoo.com>
> > >
> > > > so there is no way to pull this variable from an email form field?
> > > >
> > >
> > >
> > > Eh? Of course, $from can be set by a form field if you want. Or a
> > database,
> > > or any way you can set a variable. Then pass it to mail(), per my last
> > > message.
> > >
> > >
> > >
> > >
> > > >
> > > >
> > > > > From: "W.D." <suedeuno@yahoo.com>
> > > > >
> > > > > > I'm using a remote host, and when I call mail() with all the
var's
> > > > pulling
> > > > > > values from form fields, it still shows as nobody in from
header.
> Is
> > > > this
> > > > > a
> > > > > > server situation? Theyre using php4 support and they claim its
> that
> > > I'm
> > > > > not
> > > > > > using appropriate variables in the function.
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > You have to set the From header manually:
> > > > >
> > > > >
> > > > > <?php
> > > > > $to = "who@where.com";
> > > > > $from = "me@myserver.com";
> > > > > $subject = "Blah";
> > > > > $body = "Lorem ipsum dolor sit amet.";
> > > > >
> > > > > mail($to, $subject, $body, "From: $from");
> > > > > ?>
> > > > >
> > > > >
> > > > >
> > > > > http://www.php.net/manual/en/function.mail.php
> > > > >
> > > > >
> > > > > Regards
> > > > >
> > > > > Simon Garner
> > > >
> > >
> >
> >
> >
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com