Hi...tried to send email notification in php but not successful. When i check my email there is no email notification received. Below is the coding. Once the user click notify button, an email notification supposed to be sent to responsible person...Please advise...Thanks a lot.

error_reporting(E_ALL ^ E_NOTICE);
$conn = mysql_connect("mysql","pqa","pq");

if(count($_POST)>0) {

mysql_query("UPDATE progress set Quanprogress4='" . $_POST["Quanprogress4"] . "', Qualprogress4='" . $_POST["Qualprogress4"] . "' WHERE Targetid='" . $_SESSION["Targetid"] . "' and Progressid='" . $_SESSION["Progressid"] . "'");
$message = "Record Modified Successfully";

$result = mysql_query("SELECT * FROM progress WHERE Progressid='" . $_SESSION["Progressid"] . "'");
$row= mysql_fetch_array($result);
<title>Add New User</title>
<link rel="stylesheet" type="text/css" href="styles.css" />
<form name="frmUser" method="post" action="">
<div style="width:500px;">
<div class="message"><?php if(isset($message)) { echo $message; } ?></div>
<div align="right" style="padding-bottom:5px;"><a href="list_progress4.php" class="link"><img alt='List' title='List' src='images/list.png' width='15px' height='15px'/> List Progress</a></div>
a.i.Quantitative Progress (e.g. average,numerical,%,sum): <input type="hidden" name="Progressid" class="txtField" value="<?php echo $row['Progressid']; ?>"><input type="text" name="Quanprogress4" class="txtField" value="<?php echo $row['Quanprogress4']; ?>"><br>
a.ii.Qualitative Progress: <input type="text" name="Qualprogress4" class="txtField" value="<?php echo $row['Qualprogress4']; ?>"><br> 
<input type="hidden" name="Targetid" ><br> 
<td colspan="2"><input type="submit" name="submit" value="Submit" class="btnSubmit"></td>
<p><b>3.Improvement Plan</b></p>

Team Leader:<input type="text" name="Pic" value="<?php echo $_SESSION["Username"];?>" ><br>

$con = mysql_connect("mysql","pqa","pq");
if (!$con)


die('Could not connect: ' . mysql_error());


mysql_select_db("pqad", $con);
$sql="select * from improvement_plan";
echo "<table border=1>


    while ($record=mysql_fetch_array($myData)){

echo "<tr>";
echo "<td>" . $record['Responsible4'] . "</td>";
echo"<td>" . $record['Notify4'] . "</td>";
echo "</tr>";


echo "</table>";

<form action="" method="post">

        <input type="submit" value="Notify" />

    <input type="hidden" name="Notify4" value="Notify" />


echo 'Message has been sent'; */
$subject = "New Mailing List Signup";
$sendto = "email@domain.com";
$body = "This is the information filled out for their signup. /n /n Name: $name /n Email: $email /n /n This signup was generated by your server.";


<?php include('ipdfooter.php');?>

Edited by pritaeas: Added markdown.

2 Years
Discussion Span
Last Post by edbr

The code seems fine to me.

Just a quick question - are you testing it on an already live website or are you testing it via your localhost?


I had this problem when testing on localhost once...

The thing was, is that my xampp server didn't have a functioning mail server (SMTP). Unfortunately, you need to upload your script to a functioning server with SMTP installed/working (if I were you I'd just create a test/ directory on your webserver).

I believe it's possible to get SMTP working on XAMPP using this and theres a ZIP download to try out. I've never used this though so haave no idea how good it is.

In a nutshell: create a test/ directory on your webserver and test your scipt there.

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.