I had this working before, now it wont. When the email generates and comes to my inbox, it shows it as from "Team-DC5.com@yourhostingaccount.com" but im pretty sure i have it set to show as "Team-DC5.com" what is wrong with it.. what do i have to fix. why wont it work anymore?!?!!??!?!
< ?php
include("global.inc.php");
$errors=0;
$error="The following errors occured while processing your form input.<ul>";
pt_register('POST','Name');
pt_register('POST','Email');
pt_register('POST','Subject');
pt_register('POST','Comments');
$Comments=preg_replace("/(\015\012)|(\015)|(\012)/","&nbsp;<br />", $Comments);if($Name=="" || $Email=="" || $Subject=="" || $Comments=="" ){
$errors=1;
$error.="<li>You did not enter one or more of the required fields. Please go back and try again.";
}
if(!eregi("^+(+)*" ."@"."(+(+)*)+"."\\.{2,}"."$",$Email)){
$error.="<li>Invalid email address entered";
$errors=1;
}
if($errors==1) echo $error;
else{
$where_form_is="http".($HTTP_SERVER_VARS=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
$message="Name: ".$Name."
Email: ".$Email."
Subject: ".$Subject."
Comments: ".$Comments."
";
$message = stripslashes($message);
mail("myemail@team-dc5.com","Contact form submission",$message,"From: Team-DC5.com");
? >
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I had this working before, now it wont. When the email generates and comes to my inbox, it shows it as from "Team-DC5.com@yourhostingaccount.com" but im pretty sure i have it set to show as "Team-DC5.com" what is wrong with it.. what do i have to fix. why wont it work anymore?!?!!??!?!
< ?php
include("global.inc.php");
$errors=0;
$error="The following errors occured while processing your form input.<ul>";
pt_register('POST','Name');
pt_register('POST','Email');
pt_register('POST','Subject');
pt_register('POST','Comments');
$Comments=preg_replace("/(\015\012)|(\015)|(\012)/","&nbsp;<br />", $Comments);if($Name=="" || $Email=="" || $Subject=="" || $Comments=="" ){
$errors=1;
$error.="<li>You did not enter one or more of the required fields. Please go back and try again.";
}
if(!eregi("^+(+)*" ."@"."(+(+)*)+"."\\.{2,}"."$",$Email)){
$error.="<li>Invalid email address entered";
$errors=1;
}
if($errors==1) echo $error;
else{
$where_form_is="http".($HTTP_SERVER_VARS=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
$message="Name: ".$Name."
Email: ".$Email."
Subject: ".$Subject."
Comments: ".$Comments."
";
$message = stripslashes($message);
mail("myemail@team-dc5.com","Contact form submission",$message,"From: Team-DC5.com");
? >
#1 you are not using a formal header.
#2 the email is not a properly formated email "Team-DC5.com"
Check this site:
http://www.php.net/manual/en/function.mail.php
Example 3
Whqat do you mean im not using a formal header?
It used to work before and when the email came in it would simply say it was from "TeamDC5" i didnt need it to say Form@Team-DC5.com