PHP Code:
<?php
if ($_POST["Submit"])
{
if ($_POST["name"] and $_POST["email"] and $_POST["subject"] and $_POST["message"] )
{
//Post Data
$name = $_POST["name"];
$from= $_POST["email"];
$subject = $_POST["subject"];
$message = $_POST["message"]
$to = "info@casariegoart.com";
//Combined all post data together for the message part
$mesg = "Name: $name\t Email: $from\tSubject: $subject\t Message: $message";
//email subject
$sub = "via website (EN)";
//from email address
$frm = "From:$name <$from>";
//sendng mail as well as checking whether the mail sending is success or not
if(mail ($to,$sub,$mesg,$frm))
{
//Mail sending was success display the following part
echo '<p align="center"><font color="#003366">Thanks !<br>Your message has been sent.<br> We will get back to you as soon as we can.</font></p>';
}
else
{
//Mail sending was unsuccess display the following part
echo '<p align="center"><font color="#003366">Message Sending failed</font></p>';
}
}
else
{
echo '<p align="center"><font color="#FF0000">Please fill in all datas!</font></p><p><a href="contactEN.html">[back]</a>';
}
}
?>>
You can also check this good demo
Bookmarks