Jump to content

gardencat

New Members
  • Posts

    3
  • Joined

  • Last visited

gardencat's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thank you, cyberRobot . . . . using ($_POST['Email']) fixed the problem. Thanks for the validation info, too.
  2. I do have a Name field in the form, but can't figure out how to get that to show up in the $EmailFrom area either. Here's everything in the PHP file: <?php $EmailFrom = "Website visitor"; $EmailTo = "MyClient@HerAddress.com"; $Subject = "Message from BusinessName website"; $Name = Trim(stripslashes($_POST['Name'])); $Email = Trim(stripslashes($_POST['Email'])); $Message = Trim(stripslashes($_POST['Message'])); // validation $validationOK=true; if (!$validationOK) { print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">"; exit; } // prepare email body text $Body = ""; $Body .= "Name: "; $Body .= $Name; $Body .= "\n"; $Body .= "Email: "; $Body .= $Email; $Body .= "\n"; $Body .= "Message: "; $Body .= $Message; $Body .= "\n"; // send email $success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>"); // redirect to success page if ($success){ print "<meta http-equiv=\"refresh\" content=\"0;URL=contactthanks.php\">"; } else{ print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">"; } ?>
  3. I've made a web site (for a client) that has a contact form. The form works fine, but the email that arrives shows a long weird address, which I assume is the hosting server name: Visitor@p3nlhgxxxxxxxxxsecureserver.net. These emails look scary to my website client, and she's afraid to open them. Is there some code I can add to the php file that will change who the email appears to be from in my client's inbox? This is part of what's in the php file: $EmailFrom = "Visitor"; $EmailTo = "MyClient@HerAddress.com"; $Subject = "Message from BusinessName website"; $Name = Trim(stripslashes($_POST['Name'])); $Email = Trim(stripslashes($_POST['Email'])); $Message = Trim(stripslashes($_POST['Message'])); Disclaimer . . . I know nothing about writing PHP. TIA - gardencat
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.