यहाँ एक उदाहरण कोड:
$headers = 'From: [email protected]' . "\r\n";
$mysqli = new mysqli("localhost", "user", "password", "database");
$output = $mysqli->prepare("SELECT id FROM table WHERE x=?");
$output->bind_param("s", $parameter);
$output->execute();
$output->store_result();
$output->bind_result($id);
while ($output->fetch())
{
mail($to, $subject, $emailcontent, $additionalheader);
}
$output->close();
इन लिंक्स पर एक नज़र डालें:
1. http://php.net/manual/de/mysqli.quickstart .prepared-statements.php
2. http://us3.php.net/manual/de/book.mail .php