Send Email after mysql insert
Posted: 03 May 2016, 18:50
Hello!How can i sent am email after mysql insert?
Code: Select all
<?php
// connect to the "tests" database
$conn = new mysqli('localhost', 'root', 'pass', 'tests');
// check connection
if (mysqli_connect_errno()) {
exit('Connect failed: '. mysqli_connect_error());
}
// sql query for INSERT INTO users
$sql = "INSERT INTO `users` (`name`, `pass`, `email`)
VALUES ('Marius', 'faith', 'name@domain.net')";
// Performs the $sql query on the server to insert the values
if ($conn->query($sql) === TRUE) {
echo 'users entry saved successfully';
}
else {
echo 'Error: '. $conn->error;
}
$conn->close();
?>