<?php
//Variables - Your e-mail address (keep this file name : contact.php)
$your_email = "nbigdog2000@gmail.com";
//Show Mail Form
function showForm() {
echo "<html><head>\n"
."<title>Contact Us</title>\n"
."</head><body>\n"
."<font face='arial' size='2'>\n"
."<h1>Contact Us</h1>\n"
."<form method='post' action='contact.php?action=sendEmail'>\n"
."<table width='100%' border='0' cellspacing='0' cellpadding='4'>\n"
."<tr>\n"
."<td width='25%'><font face='arial' size='2'>Your Name:</font></td>\n"
."<td width='75%'><input type='text' name='name' size='40'></td>\n"
."</tr><tr>\n"
."<td width='25%'><font face='arial' size='2'>Your Email:</font></td>\n"
."<td width='75%'><input type='text' name='email' size='40'></td>\n"
."</tr><tr>\n"
."<td width='25%'><font face='arial' size='2'>Subject:</font></td>\n"
."<td width='75%'><input type='text' name='subject' size='40'></td>\n"
."</tr><tr>\n"
."<td width='25%'><font face='arial' size='2'>Message:</font></td>\n"
."<td width='75%'><textarea name='message' rows='10' cols='35'></textarea></td>\n"
."</tr></table>\n"
."<input type='submit' value='Send'>\n"
."</form></body></html>\n";
}
//Send Email
function sendEmail() {
global $your_email,$name,$email,$subject,$message;
if ( !$name | !$email | !$subject | !$message ) {
header ("Location: contact.php");
}
else {
$email2 = "$email ($name)";
mail( $your_email, $subject, $message, "From: $email2");
echo "<html><head>\n"
."<title>Email Sent!</title>\n"
."</head><body>\n"
."<font face='arial' size='2'>\n"
."<h1>Email Sent!</h1>\n"
."Your Email has been sent with success!\n We will contact you as soon as possible."
."</font></body></html>\n";
}
}
//Switch Statement
Switch ( $action ) {
Case 'sendEmail':
sendEmail();
Break;
Default:
showForm();
}
?>
well, thats my code, but when it sends the email, all i get is the message!
is it possible to make it send the email like so :
Name :
Email :
Subject :
Message :
and subject be "Message from Studio 17 website"
anyone, please and thanks
