...

View Full Version : Help needed in mailing the form values



The rock
10-05-2005, 07:19 PM
Hi,
Am new to PHP. I need help in mailing the values posted by a form. Ok now here is my problem.

I have a form with almost 50 fields in it. ON clicking the submit button, the values are posted to a information display page where the values are stored in a database. The information display page also echoes the posted variables in a tablefor better viewing. for ex:

First name : <? echo $_POST['Firstname']; ?>
Email id : <? echo $_POST['Emailid']; ?>

Now I need to email all these posted values to my manager from the information display page in the same format. Can any one help me in telling how to do this?

thanks in advance

NeoPuma
10-05-2005, 07:48 PM
Take a look at http://www.php.net/manual/en/function.mail.php Don't forgot, if you wanna use HTML in the email, include the HTML header.

The rock
10-05-2005, 08:18 PM
HI there,
Thanks for the link but I still think i havent got it right. I used the example from the pHP manual but it didnt work for me. Here is the code snippet.
<?
.
.
.
$message = "Line 1\nLine 2\nLine 3";

// In case any of our lines are larger than 70 characters, we should use wordwrap()
$message = wordwrap($message, 70);

// Send
$mailsent=mail('aravind_v21@yahoo.co.in','My Subject', $message);

if($mailsent)
echo "AT last";
else
echo "What the hell";
?>
I still get the "What the hell" message printed on my page!
Any idea on what went wrong?

thanks anyways.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum