Hello Ive been using Pyros [URL=http://www.webdevfaqs.com/php.php#mailer]form mailer[/URL] to send the results of a form to myself. How would i go about editing this so it sends it to an email address typed into the form (so i can use it as a tell a friend scipt).
@JonaAug 21.2004 — #[font=trebuchet ms]Add another input field, then set it as [/font][font=courier new]$email = $_POST["name_of_new_input_field"];[/font][font=trebuchet ms].[/font]
of course however, expect it to always go to junk mail because of the lack of appropriate headers. Also, you need a way to validate an email address entered. This can be done in the following manner:
[code=php] <?php if(!preg_match('/^[-!#$%&'*+\./0-9=?A-Z^_`{|}~]+@([-0-9A-Z]+.)+([0-9A-Z]){2,4}$/i', $_POST[email])) { // email is not valid... } else { mail() // you know what to put here.. } ?> [/code]
of course however, expect it to always go to junk mail because of the lack of appropriate headers. Also, you need a way to validate an email address entered. This can be done in the following manner:[/B][/QUOTE]
[font=trebuchet ms]Hellspire, Mr E is using a pre-written, easily customizable script which [i]does[/i] use the mail function; it is a simple pre-written script to avoid users from asking in these forums how to make a form mailing script. That said, the only time unsufficient headers would be the cause of a message being sent to the "Junk mail" folder is if you are using Hotmail or MSN -- my Yahoo email does not consider these messages spam, but has caught at least 90% of the spam that I get. Evidently, Hotmail's filtering system is less advanced.[/font]