Contents

 
Home
PHPRunner 6.0 manual
Prev Page Next Page
 
 

Send mass email to all users

 

To send an email with new data to email addresses from user table use the following code in one of the following events:

yellowbulbNote: Change the values listed in red to match your specific needs.

global $dal;

//select emails from Users table

$tblUsers = $dal->Table("UsersTableName");

$rs = $tblUsers->QueryAll();

while ($data = db_fetch_array($rs))

{

$email=$data["EmailAddress"];

  $from="admin@test.com";

  $msg="Check what's hot this season";

  $subject="Monthly newsletter";

  $ret=runner_mail(array('to' => $email, 'subject' => $subject

    'body' => $msg, 'from'=>$from));

  if(!$ret["mailed"])

    echo $ret["message"]."<br>";

}

For more information about using Data Access Layer (DAL), see Data Access Layer.

Converted from CHM to HTML with chm2web Standard 2.85 (unicode)