how to send mail with my form data

the mail() function

Moderators: macek, egami, gesf

Post Reply
New php-forum User
New php-forum User
Posts: 8
Joined: Thu Jun 28, 2012 4:02 am
Location: Pune

Re: how to send mail with my form data

Post by paragbhavsar » Thu Jun 28, 2012 5:07 am

Following is modified code

$mysql_query =("SELECT uid,`Name`,Department,Problem,Ext_no,Ip_Add,Remark,Email FROM entryform ORDER BY entryform.uid DESC limit 1 ");
$result = mysql_query($mysql_query);
$message = '';
while($data = mysql_fetch_row($result)){
$message .= " <td >
<td> Complaint NO. :- $data[0]</br></br></td>
<td> NAME :- $data[1]</br></br>
<td> DEPARTMENT :- $data[2] </br></br>
<td> PROBLEM :-$data[3] </br></br> </td>
<td> EXT. NO.. : $data[4]</br></br> </td>
<td> IP ADDRESS :- $data[5] </br></br> </br>
<td> REMARK :- $data[6] </br></br> </br>
<td> Mail ID :- $data[7] </br></br> </br>
$to = "";
$subject = "user complaint!";
if (mail($to, $subject, $message)) {
echo("<p>Message successfully sent!</p>");
} else {
echo("<p>Message delivery failed...</p>");

You will have to store all data in a string and pass the string to mail function as done above.

- Parag Bhavsar

Email -
Skype - paragbhavsar7777

Cell No - 9730077617

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest