i2-Services, Inc. Forums

Full Version: email membership list
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a job posting software, and I would like to integrate with php_mm. I would like to email the entire users database when a new job posting is available. Would something like this work to email only active users?

Code:
$result = queryDatabase("SELECT * FROM mm_users");
while ($row = mysql_fetch_object($result)) {
    $message = "Hello $row->name,\n\nA new job posting has been added to " . COMPANY . "'s website, please click the link below to view this job posting:\n\n" . HOME . "\n\nThank you,\n" . COMPANY . "\n\nWebsite Management - " . date('m/d/Y');

    mail($row->email, 'New Job Posting Added', $message, 'From:');
}


Thanks for any assistance.

I'm not able to test the above code, but as long as you make the connection to the MM2 db first you're on the right path.
Reference URL's