Jump to content

email function


Jenling

Recommended Posts

Can anyone tell me when this happen? the page keep show this error: "Warning: mail() [function.mail]: SMTP server response: 503 Incomplete envelope information in C:\xampp\xampp\htdocs\meetingRoom\adminNotify.php on line 32"

 

What's wrong?? I hope dear all expert can help me with this problem. Thanks!! Here are my code:

<?php require_once('connections/connect.php');?>
<?
session_start();
?>
<?
$username=$_POST[hiddenusername];
$staffID=$_POST[hiddenstaffID];
//$staff=$_POST['staff'];
$adminID=$_POST[hiddenadminID];
$Email=$_POST['Email'];
$problem=$_POST['problem'];
$admin=$_POST['admin'];
//$username=$_POST['username'];


$query= "Select username From booking ";
$result=mysql_query($query, $connect) or die ("ERROR in query: $query" .mysql_error());
$row_Recordset=mysql_fetch_assoc($result);
//echo $row_Recordset[username];

$query2= "Select Email,staffID,username From userdetails where username= '$row_Recordset[username]'";
$result2=mysql_query($query2, $connect) or die ("ERROR in query: $query2" .mysql_error());
$row_Recordset2=mysql_fetch_assoc($result2);

$query3= "Select adminID From adminlogin ";
$result3=mysql_query($query3, $connect) or die ("ERROR in query: $query3" .mysql_error());
$row_Recordset3=mysql_fetch_assoc($result3);

mail( "$Email", "SKTM Online Booking System",
  "Staff ID: 
Matter:
", "From:[email protected]" );?>

<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>SKTM Online Booking System</title>



<script language="JavaScript" src="gen_validatorv2.js" type="text/javascript"></script>

</head>
<body background="img/adminBG.jpg">

<table align="center" border="0" width="800" cellspacing="0" cellpadding="0">
<tr>
	<td rowspan="2" width="10%">
	<img border="0" src="img/UMS.jpg" width="105" height="107" align="right"></td>
	<td width="89%" height="84">
	<p align="center"><font face="Century Gothic" size="6" color="#CC0099">
	SKTM Online Booking System</font></td>
</tr>
<tr>
	<td width="89%" bgcolor="#CC0099" height="15"> <font color="#FFFFFF">Welcome! You are currently log on as <? echo "$adminID";?>
</font></font></td>
</tr>
<tr>
	<td colspan="2" bordercolor="#CC0099">
	<table border="1" width="100%" cellspacing="0" cellpadding="0" bordercolor="#CC0099">
		<tr>
			<td>
			<p align="center"> </p>
			<p align="center"><font size="2" face="Verdana">To notify user regarding the booking, please click the 'send' button 
			</font></p>
			<form name="myform" method="POST" action="adminNotify2.php">
				<div align="center">
				<table border="0" width="367" cellpadding="0">
					<tr>
						<td bgcolor="#CC0099">
						<p style="margin-top: 0; margin-bottom: 0">
						<font color="#FFFFFF" face="Verdana" size="2"> Staff 
						ID</font></td>
						<td width="270"> <input type="text" name="staffID" id="staffID"size="20" maxlength="5" value="<? echo $row_Recordset2[staffID] ?>"><p style="margin-top: 0; margin-bottom: 0">
						<font face="Verdana" size="1"> </font></td>
					</tr>
					<tr>
						<td bgcolor="#CC0099">
						<p style="margin-top: 0; margin-bottom: 0">
						<font color="#FFFFFF" face="Verdana" size="2"> username </font></p>							</td>
						<td width="270">
						 <input type="text" name="username" size="20" id="username" maxlength="30" value="<? echo $row_Recordset[username] ?>"> 
						<p style="margin-top: 0; margin-bottom: 0">
						<font face="Verdana" size="1"> </font></td>
					</tr>
					<tr>
						<td bgcolor="#CC0099">
						<p style="margin-top: 0; margin-bottom: 0">
						<font color="#FFFFFF" face="Verdana" size="2"> Email							</font></td>
						<td width="270"> <input type="text" name="Email" value=" <? echo $row_Recordset[username] ?>@localhost ">
						<p style="margin-top: 0; margin-bottom: 0">
						<font face="Verdana" size="1"> </font></td>
					</tr>
					<tr>
						<td bgcolor="#CC0099">
						<p style="margin-top: 0; margin-bottom: 0">
						<font color="#FFFFFF" face="Verdana" size="2">  Admin ID </font></p>							</td>
						<td width="270">
						 <input type="text" name="adminID" size="20" id="adminID" maxlength="20" value="<? echo "$adminID";?>"> 
						<p style="margin-top: 0; margin-bottom: 0"><font face="Verdana" size="1"> </font></td>
					</tr>
					<tr>
						<td bgcolor="#CC0099">
						<p style="margin-top: 0; margin-bottom: 0">
						<font color="#FFFFFF" face="Verdana" size="2"> Requested</font></p>
						<p style="margin-top: 0; margin-bottom: 0">
						<font face="Verdana" size="2" color="#FFFFFF"> Statement</font></td>
						<td width="270">
						 <textarea rows="14" name="problem" cols="30">Your booking recently for meeting room has been confirmed</textarea></td>
					</tr>
				</table>
				</div>
				<p align="center">
				<input type="submit" value="Send" name="submit" id="submit">       
				<input type="reset" value="Clear" name="reset" id="reset"></p>
				<input type="hidden" name="hiddenadminID" value="<? echo $row_Recordset3[adminID] ?>" />
			</form>

I think there's stg wrong with the variable i post. Can anyone check out for me and tell me as soon as possible?? Thanks!!!!

Link to comment
https://forums.phpfreaks.com/topic/100093-email-function/
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.