Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $subject = 'Message from Website'; // Subject of your email
- $to = 'me@mydomain.com'; //Recipient's E-mail
- $emailTo = $_REQUEST['email'];
- $headers = "MIME-Version: 1.1";
- $headers .= "Content-type: text/html; charset=iso-8859-1";
- $headers .= "From: " . $emailTo . "rn"; // Sender's E-mail
- $headers .= "Return-Path:". $emailTo;
- $message .= 'Name : ' . $_REQUEST['name'] . "n";
- $message .= 'Email : ' . $_REQUEST['email'] . "n";
- $message .= 'Phone : ' . $_REQUEST['phone'] . "n";
- $message .= 'Message : ' . $_REQUEST['message'];
- if (@mail($to, $subject, $message, $headers))
- {
- // Transfer the value 'sent' to ajax function for showing success message.
- echo 'sent';
- }
- else
- {
- // Transfer the value 'failed' to ajax function for showing error message.
- echo 'failed';
- }
- ?>
- // To send HTML mail, the Content-type header must be set
- $headers = 'MIME-Version: 1.0' . "rn";
- $headers .= 'Content-type: text/html; charset=iso-8859-1' . "rn";
- // Additional headers
- $headers .= 'To: Mary <mary@example.com>, Kelly <kelly@example.com>' . "rn";
- $headers .= 'From: Birthday Reminder <birthday@example.com>' . "rn";
- $headers .= 'Cc: birthdayarchive@example.com' . "rn";
- $headers .= 'Bcc: birthdaycheck@example.com' . "rn";
- // Mail it
- mail($to, $subject, $message, $headers);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement