0

How to send user detail page to my email.with full deatils

<?php
mysql_connect("localhost","root","");
mysql_select_db("Users");
$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);
while($data = mysql_fetch_row($result)){
  echo(" <td > 
  <tr>
  <td> Complaint NO. :- $data[0]</br></br></td>   
  <td> NAME :-   $data[1]</br></br>   
  </td> 
  <td> DEPARTMENT :-  $data[2] </br></br>  
  </td>
  <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>
  </td>
  </tr>
  ");
}
$to = "support.kaizen@rpr.jspl.com";
 $subject = "user complaint!";
 $massage = "$result";
 if (mail($to, $subject, $massage)) {
   echo("<p>Message successfully sent!</p>");
  } else {
   echo("<p>Message delivery failed...</p>");
  } 
?>
4
Contributors
7
Replies
8
Views
5 Years
Discussion Span
Last Post by pritaeas
0

Instead of echo'ing to standard output, you should capture this info in a variable (add it to $massage).

0

Hear is my code .there is a problem only show 1 field (name). iwant to display all filds in my mail page.

<?php 
$con = mysql_connect("localhost","root",""); 
if (!$con) 
  { 
  die('Could not connect: ' . mysql_error()); 
  } 

mysql_select_db("users", $con); 

$sql="INSERT INTO entryform (Name, Department, Problem, Ext_no, Ip_Add, Remark, Email) 
VALUES ('$_POST[Name]','$_POST[Department]','$_POST[Problem]','$_POST[Ext_no]','$_POST[Ip_Add]','$_POST[Remark]','$_POST[Email]')"; 

if (!mysql_query($sql,$con)) 
  { 
  die('Error: ' . mysql_error()); 
  } 
  echo "Your Information Was Successfully Posted"; 


mysql_close($con); 

$to = "Support.kaizen@rpr.jspl.com";  
$subject = "User Complaint"; 
$email = $_POST['Email'] ;  
$message = $_REQUEST['Name'] ; 

$sent = mail($to,$subject,$email, $message) ;  
if($sent)  
{print "Your mail was sent successfully"; } 
else  
{print "We encountered an error sending your mail"; } 
?>
1

You should build your message:

$message = $_POST['Name'];
$message .= $_POST['Department'];
$message .= $_POST['Problem'];
// and so on
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.