Re: Getting the "From: admin@site.com" to work
| From: | Andre Dubuc | Date: | Sat, 26 Oct 2002 20:49:55 +0000 |
| Subject: | Re: Getting the "From: admin@site.com" to work | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-121549@lists.php.net to get a copy of this message | ||
Thanks John,
I had the maual in front of me, but I didn't understand that you had to put
the 'From:' stuff in a 'header'. That's why it wasn't working. I
presumed
(wrongly again) that 'headers' were optional, and I got sidetracked by the
success of the "To:" field.
Thanks for clearing that up.
Regards,
Andre
On Saturday 26 October 2002 04:42 pm, John W. Holmes wrote:
> [snip]
>
> > if(@mail($to, $from, $subject, $message))
>
> Go back to the manual. The parameters for mail are
> mail(to,subject,message,headers).
>
> You have to pass the From: address in the headers.
>
> $to = "you@domain.com";
> $subject = "Your email";
> $message = "Your email is good";
> $headers = "From: john@mydomain.com\r\n";
>
> mail($to,$subject,$message,$headers);
>
> Read the manual on other headers you can send.
>
> ---John Holmes...