looking to use one webpage for a user to add information and i am using a button to pass that data onto another page, that other page adds the data into a database - this is all working
as part of clicking on the button i want an email to be sent automatically to an email address to say something has been added to the database
so the email is acting like a notification
i can get the email function to work on a single page, but when added to the page i want it to work on it doesn't work.
any help would be appreciated as to why this doesn't work:
UPDATED CODE, it sends an email on a single page, but the button here passes the data onto another page, but it will add to the database, but wont send the email...
echo "</form>";
}
echo "</table>";
} else {
echo "You have successfully added the property to the current portfolio";
}
if(isset($_POST['submit']))
{
$to = 'Property Administrator <admin@luxor-estates.com>';
$subject = 'IMPORTANT: Property has been added and needs to be reviewed';
$body = 'Property has been added to the Luxor Estates Portfolio and needs to
be reviewed. Many thanks.';
mail($to, $subject, $body);
}
$conn->close();
[/insert_php]