Jump to content

[SOLVED] not receiving all text inputed through my email


cluce

Recommended Posts

I am baffled. Can someone tell me why the only output I receive in my email is the message: what ever submitted showed up. My name and email doesn't work???

 

here is my code........

<?php
echo "<p>Thank you, <b>".$_POST["name"]."</b>, for your message!</p>";
echo "<p>Your email address is: <b>".$_POST["email"]."</b>.</p>";

//set up the mail
$recipient = "cluce@mydomain.com";
$subject = "Form Submission Results"; 

//start building the mail string 
$msg = "name: ".$_POST["name"]."\n";
$msg = "email: ".$_POST["email"]."\n";
$msg = "message: ".$_POST["message"]."\n";

//send mail
mail ($recipient, $subject, $msg);
?>

 

Link to comment
Share on other sites

whenever you are setting your variable $msg you need to concate it with ( .= )

 

what you have now is setting $msg to name, then over writing that with email, and finally setting $msg to the message

 

$msg = "name: ".$_POST["name"]."\n";
$msg .= "email: ".$_POST["email"]."\n";//dont forget the period before the equal sign
$msg .= "message: ".$_POST["message"]."\n";//dont forget the period before the equal sign

 

EDIT:

THIS SHOULD BE POSTED IN THE PHP FORUM, NOT THE MYSQL FORUM

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.