We Have moved the Script to a New Web Page, that has more detailed
information and we will keep this Form as a User Support for the Simple
PHP Form Mailer,
All new updates and other information will be available on this site.
http://www.onetforum.com/formmailer/
======================================
Here's a Simple PHP fourm Mailer that you can use with any kind of a HTML form.
how to use.
on your HTML form change the line action to the script
- Code: Select all
<form name="form" method="POST" action="mail.php">
action to "mail.php"
the mail.php will redirect to a page after sending the mail to one page or to a defrant page if the user didnt submit the email address.
- Code: Select all
<?php
# PHP Basic Form Mailer by Kalinga Athulathmudali
# mail.php
# 2006-Feb-23
## Global Setings ##
# Error page (if some one fail to fill the forum)
$eurl = "error.html";
# Send Successfully Page (Confirm page that will get directed after the email was send)
$furl = "thanks.html";
# Mail Subject
$subject = "Test Fourm";
####################
$email = $_POST['email'];
if ($email) {
foreach ($_POST as $key => $val){
$msg = "$msg \n $key : $val ";
}
# Change the email address (admin@domain.com) to
# where you want your mail to be send.
mail("admin@domain.com", "$subject", "$msg",
"From: <$email>\n"
. "X-Mailer: PHP Mailer\n"
. "Content-Type: text/html; \n charset=iso-8859-1 \n");
header ("Location: $furl");
}
else {
header ("Location: $eurl");
die();
}
?>
copy the above code and save the file as mail.php, make sure to chnage the admin@domain.com to the address where you form to be email to.
aslo there must be a form feeld call "email". where this will be used as a Email address of the email, if this is not there on your form the mailer will not work.
