/    Sign up×
Community /Pin to ProfileBookmark

send info from a html form to email

Hey guys!

Does somebody have a link to a good tutorial of an online feedback form or some piece of code?

I just, need to send a form via email, something like a feedback form…
Thanks for helping!

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@knowjSep 08.2006 — something along them lines would work just useing a simple mail script.

im no php expert so theres probably alot better way that that but its a start.

[code=php]//set the email address which the message will be sent to
$email = "[email protected]";
//set the var for the subject
$subject = "email subject";
//set the var for the clients message
$message =
"form input 1 ". $_POST['form details1'] .
"form input 2 ".$_POST['form details2'].
"end of form"
;

//email header
$headers = 'From:' . $_POST['email'] . "rn";
//check if the client has entered there email address and a message also check if the form has been submitted
if (isset($_POST['form details1']) && ($_POST['form details1']) && ($_POST['action'] == 'submitted'))
{
//send the email
mail($email, $subject, $message, $headers);
//thank the user for sending the email
echo "<h1>Thankyou for filling in the form</h1>";
//give the user feadback of the message they sent
echo "<p>Subject: $subject</p><p>Message: $message</p>nr";
}
else
{
?>

your form

<?
}
?>
[/code]
Copy linkTweet thisAlerts:
@pcthugSep 08.2006 — Look at the [url=http://www.php.net/mail/]mail[/url] functions
Copy linkTweet thisAlerts:
@byte_eaterauthorSep 08.2006 — Thanks a lot for information and references!
×

Success!

Help @byte_eater 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 6.17,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...