send email when form is submitted php

Solutions on MaxInterview for send email when form is submitted php by the best coders in the world

showing results for - "send email when form is submitted php"
Apolline
17 Oct 2017
1<?php 
2if(isset($_POST['submit'])){
3    $to = "email@example.com"; // this is your Email address
4    $from = $_POST['email']; // this is the sender's Email address
5    $first_name = $_POST['first_name'];
6    $last_name = $_POST['last_name'];
7    $subject = "Form submission";
8    $subject2 = "Copy of your form submission";
9    $message = $first_name . " " . $last_name . " wrote the following:" . "\n\n" . $_POST['message'];
10    $message2 = "Here is a copy of your message " . $first_name . "\n\n" . $_POST['message'];
11
12    $headers = "From:" . $from;
13    $headers2 = "From:" . $to;
14    mail($to,$subject,$message,$headers);
15    mail($from,$subject2,$message2,$headers2); // sends a copy of the message to the sender
16    echo "Mail Sent. Thank you " . $first_name . ", we will contact you shortly.";
17    // You can also use header('Location: thank_you.php'); to redirect to another page.
18    }
19?>
20
21<!DOCTYPE html>
22<head>
23<title>Form submission</title>
24</head>
25<body>
26
27<form action="" method="post">
28First Name: <input type="text" name="first_name"><br>
29Last Name: <input type="text" name="last_name"><br>
30Email: <input type="text" name="email"><br>
31Message:<br><textarea rows="5" name="message" cols="30"></textarea><br>
32<input type="submit" name="submit" value="Submit">
33</form>
34
35</body>
36</html> 
Mads
22 Sep 2016
1
2<!DOCTYPE html>
3<html>
4<head>
5<title>FeedBack Form With Email Functionality</title>
6<link href="css/elements.css" rel="stylesheet">
7</head>
8<!-- Body Starts Here -->
9<body>
10<div class="container">
11<!-- Feedback Form Starts Here -->
12<div id="feedback">
13<!-- Heading Of The Form -->
14<div class="head">
15<h3>FeedBack Form</h3>
16<p>This is feedback form. Send us your feedback !</p>
17</div>
18<!-- Feedback Form -->
19<form action="#" id="form" method="post" name="form">
20<input name="vname" placeholder="Your Name" type="text" value="">
21<input name="vemail" placeholder="Your Email" type="text" value="">
22<input name="sub" placeholder="Subject" type="text" value="">
23<label>Your Suggestion/Feedback</label>
24<textarea name="msg" placeholder="Type your text here..."></textarea>
25<input id="send" name="submit" type="submit" value="Send Feedback">
26</form>
27<h3><?php include "secure_email_code.php"?></h3>
28</div>
29<!-- Feedback Form Ends Here -->
30</div>
31</body>
32<!-- Body Ends Here -->
33</html>
34Copy
queries leading to this page
sending html form data to an email address without phpphp mailer from html formphp form email sendsend form data email using phpsend data from html form to email with phpsend a form to email in phphow to send email after form submit with phpemail on form submition php codeget form data and send to email using phpform email submit php codeemail with form phphow to create a form in html and send it to email without phphow to send a form to an email phpsend email using php after submitting formphp form submit emailphp send email functioncustom php send email htmlform send email phpphp email from sendhow to send email from php websitesend form data to email using javascript and phphow to submit a form to email html phphow to send an email via form phpsend submit form information to email phpsend email using html form and phphow to send email from php form tphp to send email from formphp send email from input formphp form submit action and send emailphp send email formsend email with php html form on submitphp submit email valuehow to send an email using phpphp form email bodyhow to send email via php formhtml and php code for email sendhow to submit form in php and mail the detailshow to receive and send email with phphow to send email using phpphp form to email scripthow to make email submition form with phpsend submitted information php to my emailsend email from form phpphp code to send email for formsend email with php from html form on submitsend email from form submit phphow to send email with the form action phpphp how to send emailhow to send a form to an email php localhosthow to send email in php with mail functionsend email using phpphp form submit to emailhow to send email in phpcontact form with email sending in phpphp send an email from formsubmit form php send mail codesending html form data to an email address using phpsending an email from form using phpphp form to email codephp email form resultsend html form to email phpphp send email from serversending mail on form submission in phphow to send data from form to email and database in phpsend form data to email using phphow to send an email with phpcreate an html form that on submit send an email with the fields phpphp email submit formphp send form data to emailsend email with post phpho to get email on form phpphp method send emailsend email form phpemail htm form using phpphp send email as htmlhow to send an email via phpsending email php form htmlphp send html email formhow to send html form data to email using phpcontact form send email phpsend email form server email id phpphp submit form emailhow to send email in php with htmlsend email to form database phpphp send form to emailhow to send form data to email in phpform to send email phpsend an email from php scriptphp send form information via emailhow to send form into email using phpget php to send email from formsend email from html form with phpsend html in php emailhtml form to email with phpphp send email when post is submittedsend form input to email phphow to send data to email on submit in phphow to host email send form phphow to make a working email form phpsend email using php and htmlphp email form phpsend from in php mailcreate an html form that upon submit send an email with the fields phpphp submit form to emailhow to send email in php using contact formphp code to send email from contact formphp form send emailphp form to emailsubmit form also on email phpwhat is the output of php email form sendsend email from html form phpphp form send to emailsend html form data to email using phphow to send form data to email using phpmake an form to send email with phpphp how to send html emailsend email by php formnot able to receive sender email id by php email formsend email through php formform action send email phpsend an email in phpsend email on form submit in html using phpsending form data into an email phpphp send email from formphp form post emailform that sends email phpget email from form phpform submit email phphtml form to php emailform data send to email using phpsend form data in email phphow to send email on form submission phpphp get html as string but want to send emailphp send email with htmlsubmit form and send email in phpphp form that sends emailphp code for form submission to emailwhen we submit a form mail will sent in phpsend email from server phpphp send form by emailform php email sendphp send emailhow to make a php form send to emailsending an email on form submission using phphow to connect email in the form with database using phpphp form to email formatsend form email phpphp code to send emailcreate php to email formsend data from html form direct to email using phpphp email form infohow to make php form send emailphp send email after form submittedsimple form to send email phpemail form data phphow to send html page in email using phpsend email php formphp form send email on submitsend email using php from a formsend html form data to email phpphp email send formphp form send to mailhow to send email form phphow to make a php script that sends an email after form is sbumbitedhow to send email from contact form in phphow to send email from php formphp send email htmlsend email contact form phpphp submit data to emailphp send form mailform php to emailphp email form codephp code to send email from a form submissionphp code for sending form data to emailemail send phpsending email using php formsending form data to an email phpsend data from form to email phphow to send data to email from php formsend email from email address in php formhow to send form to email and database using phpphp sending email formsimple php form to emailhow to send data from html form to email in phpphp form email addresscontact form to send on email phphow to send email with phpsend an email using phpprocess html form to email with phpsend email when form is submitted phphtml send email phpsend html email in phpphp send email responsesend email from phpphp email formphp code to send form into emailsend an email when a contact form was submitted phpform to email phpform email submit phpsend form data to email phpsend an email on form submission using phpsend email with php scriptphp form send data to emailphp form to email explainedhow to send email using php formsend mail from html form using phpsend form to email with phphow to send an email from a php formphp code for sending email from a formhow to send form data to email phpsubmit form to email phphow to send an email from php formphp how to send an email from formsend form mail using mail php functionsend email post phpsend email when form is submitted php