Most visitors online was 12720 , on 2 May 2024
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature currently requires accessing the site using the built-in Safari browser.
$data = mysql_query("SELECT Email FROM Account")
<?php
$to = $data;
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
if (mail($to, $subject, $body)) {
echo("<p>Message successfully sent!</p>");
} else {
echo("<p>Message delivery failed...</p>");
}
?>
<?php
//run query to get emails
$query = mssql_query('SELECT Email FROM Account');
$data = array();
while($row = mysql_fetch_array($query)) {
$data[] = $row['email'];
}
//will seperate emails by comma so they can all be sent as once
$to = implode(", ", $data);
//from
$from = "no-reply@yourwebsite.com";
//reply_to
$reply_to = "whodoyouwanttheusertoreplyto@yourwebsite.com";
//Email Headers
$headers = "From: " . strip_tags($from) . "\r\n";
$headers .= "Reply-To: ". strip_tags($repy_to) . "\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
//Email Subject
$subject = "Test mail";
//Message May Include HTML sense its content type is defined as text/html in header
$message = "<b>Hello!</b><br /> This is a simple email message.";
mail($to,$subject,$message,$headers);
?>
<?php
//run query to get emails
$query = mssql_query('SELECT * FROM Account');
//from
$from = "no-reply@yourwebsite.com";
//reply_to
$reply_to = "whodoyouwanttheusertoreplyto@yourwebsite.com";
//Email Headers
$headers = "From: " . strip_tags($from) . "\r\n";
$headers .= "Reply-To: ". strip_tags($repy_to) . "\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
//I would put subject here if its not different for every user else u can put it in the while() loop.
$subject = "Test mail";
while($row = mysql_fetch_array($query)) {
//Email Subject
$message = "<b>Hello!</b><br /> This is a simple email message. <br />Your username is". $row['UserID'];
mail($row['email'],$subject,$message,$headers);
}
?>