help with php mail
i have a php script that is used as a contact form and sends me an email when someone hit submit:here is the code:
<?php
/************************************************************************/
/* PHP ContactMe v1.0 */
/* =========================== */
/* */
/* Written by Steve Dawson - http://www.stevedawson.com */
/* Freelance Web Developer - PHP, Perl and Javascript programming */
/* */
/* This program is free software. You can redistribute it and/or modify */
/************************************************************************/
##
## -- --------- START OF CONFIG SECTION --------- ##
## STEP ONE: Change the info below to your details
$SendToEmail = "myemail@domain.com"; ## Your Email Address
$YourWebsiteURL = "http://www.mysite.com"; ## Your Website URL
$YourName = "sir_han"; ## Your Name or Company Name
$yoursubject = "my subject"; ## The Email Subject Line
$ThankyouURL = "http://www.mysites.com/thank_you_url.html"; ## Send them here after they have filled in the form
## STEP TWO: Change details below for the email footer of the confirmation email.
$EmailFooter = "
";
## ---------- END OF CONFIG SECTION ------------- ##
## If they call this page direct from the browser, send them away because they havent filled in the form!
if(!isset($email)) {
header("location: $YourWebsiteURL"); ## Redirect them to your websites front page
exit();
}
## Send the Email to you ....
$yoursubject = "$yoursubject";
$emailtext = "
-----------------------------------------------------------------------------
".$yoursubject."
-----------------------------------------------------------------------------
Name: ".$name."
Email: ".$email."
Message: ".$message."
";
$yoursubject = stripslashes($yoursubject);
$emailtext = stripslashes($emailtext);
@mail("$SendToEmail", $yoursubject, $emailtext, "From: $email"); ## Email Sent
## Now lets send a thankyou email to the sender
$emailsubject = "Re: ".$yoursubject."";
$autoemail = "
-----------------------------------------------------------------------------
Re: ".$yoursubject."
-----------------------------------------------------------------------------
Thank you ".$name." for the message sent at mysite.com.
The details you entered are:
Name: ".$name."
Email: ".$email."
Message: ".$message."
".$EmailFooter."
";
$yoursubject = stripslashes($yoursubject);
$autoemail = stripslashes($autoemail);
@mail($email, $emailsubject, $autoemail, "From: $SendToEmail");
header("Location: $ThankyouURL"); ## Don't change this, change the $ThankyouURL at the top!
exit;
?>
/************************************************************************/
/* PHP ContactMe v1.0 */
/* =========================== */
/* */
/* Written by Steve Dawson - http://www.stevedawson.com */
/* Freelance Web Developer - PHP, Perl and Javascript programming */
/* */
/* This program is free software. You can redistribute it and/or modify */
/************************************************************************/
##
## -- --------- START OF CONFIG SECTION --------- ##
## STEP ONE: Change the info below to your details
$SendToEmail = "myemail@domain.com"; ## Your Email Address
$YourWebsiteURL = "http://www.mysite.com"; ## Your Website URL
$YourName = "sir_han"; ## Your Name or Company Name
$yoursubject = "my subject"; ## The Email Subject Line
$ThankyouURL = "http://www.mysites.com/thank_you_url.html"; ## Send them here after they have filled in the form
## STEP TWO: Change details below for the email footer of the confirmation email.
$EmailFooter = "
";
## ---------- END OF CONFIG SECTION ------------- ##
## If they call this page direct from the browser, send them away because they havent filled in the form!
if(!isset($email)) {
header("location: $YourWebsiteURL"); ## Redirect them to your websites front page
exit();
}
## Send the Email to you ....
$yoursubject = "$yoursubject";
$emailtext = "
-----------------------------------------------------------------------------
".$yoursubject."
-----------------------------------------------------------------------------
Name: ".$name."
Email: ".$email."
Message: ".$message."
";
$yoursubject = stripslashes($yoursubject);
$emailtext = stripslashes($emailtext);
@mail("$SendToEmail", $yoursubject, $emailtext, "From: $email"); ## Email Sent
## Now lets send a thankyou email to the sender
$emailsubject = "Re: ".$yoursubject."";
$autoemail = "
-----------------------------------------------------------------------------
Re: ".$yoursubject."
-----------------------------------------------------------------------------
Thank you ".$name." for the message sent at mysite.com.
The details you entered are:
Name: ".$name."
Email: ".$email."
Message: ".$message."
".$EmailFooter."
";
$yoursubject = stripslashes($yoursubject);
$autoemail = stripslashes($autoemail);
@mail($email, $emailsubject, $autoemail, "From: $SendToEmail");
header("Location: $ThankyouURL"); ## Don't change this, change the $ThankyouURL at the top!
exit;
?>