Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- if (isset($_POST['fullname']) && isset($_POST['email']) && isset($_POST['phone'])) {
- $fullname = $_POST['fullname'];
- $email = $_POST['email'];
- $phone = $_POST['phone'];
- $headers = "MIME-Version: 1.0"."rn";
- $headers.= "Content-type:text/html;charset=UTF-8"."rn";
- $headers.= 'From: <'.$email.'>'."rn";
- $mailto = "google@gmail.com";
- $subject = "Web Design & Development Service";
- $msg2send = "Hi $fullname,
- Hi, we have received one fresh query for you.
- Name: $fullname
- Email: $email
- Phone: $phone ";
- $msg2send = nl2br($msg2send);
- if (mail($mailto, $subject, $msg2send, $headers)) {
- echo "Thanks for writing to us. We will get back to you as soon as possible.";
- } else {
- echo "Please fill out all the mandatory fields.";
- }
- } else {
- echo "Your enquiry could not be sent for some reason; please try sending us again.";
- }
- ?>
- <?php
- session_start();
- if (isset($_POST['fullname']) && isset($_POST['email']) && isset($_POST['phone'])) {
- $fullname = $_POST['fullname'];
- $email = $_POST['email'];
- $phone = $_POST['phone'];
- $headers = "MIME-Version: 1.0"."rn";
- $headers.= "Content-type:text/html;charset=UTF-8"."rn";
- $headers.= 'From: <'.$email.'>'."rn";
- $mailto = "google@gmail.com";
- $subject = "Web Design & Development Service";
- $msg2send = "Hi $fullname,
- Hi, we have received one fresh query for you.
- Name: $fullname
- Email: $email
- Phone: $phone ";
- $msg2send = nl2br($msg2send);
- if (mail($email, $subject, $msg2send, $headers)) {
- echo "Thanks for writing to us. We will get back to you as soon as possible.";
- } else {
- // #1: Swipe with #2
- echo "Your enquiry could not be sent for some reason; please try sending us again."; // Flip this with #2
- }
- } else {
- echo "Please fill out all the mandatory fields."; // #2
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement