/    Sign up×
Community /Pin to ProfileBookmark

Tell A Friend Script

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).

Thanks

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@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]
Copy linkTweet thisAlerts:
@HellspireAug 21.2004 — Why would you not just use the mail() function provided in php?????

then you could just go

mail($_POST[email],$_POST[subject],$_POST[message]);

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]


hope this helps.
Copy linkTweet thisAlerts:
@JonaAug 21.2004 — [i]Originally posted by Hellspire [/i]

[B]Why would you not just use the mail() function provided in php?????



then you could just go

mail($_POST[email],$_POST[subject],$_POST[message]);



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]
×

Success!

Help @Mr_E spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.8,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...