Jump to content

Archived

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

lional

Bulk Mail script

Recommended Posts

I would like to have a script where I can pull email addresses from a mysql table, and then either select all of the email addresses or selected email addresses and send a message to them all simultaneously

Any idea where I can get info on such a script

Regards

Lional

Share this post


Link to post
Share on other sites
Use this script:
[code]<?php
session_start();
include "connect";

if($_POST['mes'])
{
$ax=mysql_query("SELECT * FROM users",$c);
while($r=mysql_fetch_array($ax))
{
$to=$r['email'];
$subj = "News from YourSite";
$mess =$_POST['mes'];
$headers ="From: noreply@yoursite.com
";
mail($to,$subj,$mess,$headers);
}
print "Newsletter sent to ".mysql_num_rows($ax)." Users";
}
else
{
print "Send Newsletter to everyone!!.<br />
<form action='nletter.php' method='post'>
<textarea cols=30 rows=15 name='mes'>
</textarea>
<input type='submit' value='Send!'></form>";
}
?>[/code]

Share this post


Link to post
Share on other sites
Is there a way to do something like this, on scheduled time/days?  I have an event calendar that I would like to be able to email all registered users reminders of the events automatically.  This script takes care of the bulk mailing, but is there a way to schedule it?

Share this post


Link to post
Share on other sites

×

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.