Jump to content

mail() help needed


manu_ghimire

Recommended Posts

hello

 

i just got this code for mailing the form data to email

i am having mulptipe fileds in form other then subject message

look at the code

 

<form method=post action=mailtest.php>
First Name <input type=text name=firstName>
Favorite Food <input type=text name=favoritefood>
Hobby<input type=text name=hobby>
email<input type=text name=email>
<input type=submit>
</form>

]

 

now mailtest.php

 

<?
$body = "Someone submitted the following information from our Astromatch form.
First Name: $firstname
Favorite food: $favoritefood
Hobby: $hobby
email: $from
";
$from=$_POST['email'];
mail("[email protected]", "hello", $body ,"From: $from\n");
?>
email sent successfully!

 

 

now problem here is i am able to recieve the email successflly but the problem is the fileds inside the body which are

firstname

fav food

hobby

 

are not there in email

email recieved is like this

-------

Firstname :

favfood:

hobby:

 

 

thanx for paying attention kindly tell me where should i make the changes

 

Link to comment
https://forums.phpfreaks.com/topic/44602-mail-help-needed/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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