Re: Example of mail()
| From: | benmoreassynt | Date: | Fri, 28 Apr 2006 21:41:37 +0000 |
| Subject: | Re: Example of mail() | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-41772@lists.php.net to get a copy of this message | ||
benmoreassynt wrote:
> I would try something like this:
>
>
> if(isset($_REQUEST['send_mail']))
> {
> mail($_REQUEST['address_mail'],$_REQUEST['subject']
> $_REQUEST['message']);
> unset($_REQUEST);
> }
As a follow up, if you want to use that in a public environment, you really
need to run the $_REQUEST array through something like strip_tags() at the
very least, and probably write your script in such a way that nobody can
inject headers into the form for spamming. The archives of the PHP mailing
list include ways to do it.
BMA