Jump to content

Mass Email Script


wemustdesign

Recommended Posts

I think this will work:

 

 

<?php
$con = mysql_connect("localhost","hhh","hhh");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("Blah", $con);

$result = mysql_query("SELECT * FROM users");

while($row = mysql_fetch_array($result))
  {

$from = "From: <[email protected]> ";
$to = " " . $row['email'] . " ";
$subject = "title ";
$message="

Message

";
$message = stripslashes($message);

if (mail($to,$subject,$message,$from)) {
echo "Email sent";
} else {
echo "MAIL FAILED";
}

  }

mysql_close($con);
?> 

 

Sorry if it doesn't work, I havn't tested it.

:)

Link to comment
https://forums.phpfreaks.com/topic/203412-mass-email-script/#findComment-1065765
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.