note 92662 deleted from function.mail by cmb
| From: | cmb@php.net | Date: | Fri, 15 May 2015 19:30:26 +0000 |
| Subject: | note 92662 deleted from function.mail by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-202555@lists.php.net to get a copy of this message | ||
Note Submitter: Tomer
----
I was trying to create a script that would send large forms without having to get/post each value
first and came up with this... should help someone to save valuable time.
<?php
$emailSentTo = "";
$subjectOfEmail = "";
//========= no need to edit bellow
// Set HTML Mail Header
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// The Message
$message = $GLOBALS["HTTP_SERVER_VARS"]["REQUEST_URI"];
//Cleaning Message
$message =
str_replace('?','<br><hr>',str_replace('/','File used
for submittimg this form: ',str_replace('=',':
',str_replace('&','<br>',$message))));
// Sending
mail($emailSentTo, $subjectOfEmail, $message, $headers);
//Thanking
echo "<script language=\"javascript\" type=\"text/javascript\">
alert('Thank You, We will contact you shortly.');
window.location = \"http://$_SERVER[HTTP_HOST]\";
</script>
";
?>