/*
--------------------------------------------------------------
|MD Contact version 2.1 |
|(c)Matthew Dingley 2002 |
|For more scripts or assistance go to MD Web at: |
|www.matthewdingley.co.uk |
|You may use this program only if the copyright remains |
|intact. If it is not, it is a breach of your use of this |
|program. |
|You are free to use this program on a non commercial site. |
|To use this program on a commercial site, you need a licence|
|Go to my website for more details |
--------------------------------------------------------------
*/
$subject = $_POST['subject'];
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
//Here are the things you need to change
//Your email address
$emaddress = "v.tabard@terratettofiorentino.com";
//This is the colour that will go round the box if the user forgets to fill it in in HEX
$embordercolor = "#ff0000";
//The title of your website
$sitetitle = "terratettofiorentino.com";
//HTML E-mail. If you can recieve HTML e-mail you should set this to 1
//0 is off and 1 is on. Defult is off. You may want to change the $autobody variable in the code
$htmlemail = 1;
//Auto-responder. This will send a thank you message to the user. Note : Some people may find this annoying
//0 is off and 1 is on. Defult is off. You may want to change the $autobody variable in the code
$autoresponder = 0;
//Do not change anything below here
/*----------------------------------------------------------------------------------*/
$validstring = '^([._a-z0-9-]+[._a-z0-9-]*)@(([a-z0-9-]+\.)*([a-z0-9-]+)(\.[a-z]{2,3}))$';
if (!eregi($validstring,$email)&&$email) {
$emailcorrect = 0;
}
else {
$emailcorrect = 1;
}
if($email&&$message&&$subject&&$name&&$emailcorrect) {
if($autoresponder)
{
$autobody = "Merci ! Votre e-mail a été envoyé. Une réponse devrait bientôt vous parvenir !
From
$sitetitle
";
$autosubject = "Thank you from $sitetitle";
mail($email, $autosubject, $autobody, "From: $sitetitle");
}
$headers = "From: " . trim($email) . " <" . trim($name) . ">\n";
if($htmlemail)
{
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$body = "E-mail de $email <$name>.
Message :
$message";
}
else
{
$body = "E-mail de $email <$name>.
Message :
$message.";
}
$thesubject = "$sitetitle - $subject";
if(mail($emaddress, $thesubject, $body, $headers)) {
echo "
Your e-mail was sent successfully. Thank you for the message " . $name . ".";
}
else {
echo "Sorry, $name, an error occured. Please try again.