This topic is locked

Sending Group Email

2/7/2009 3:00:10 AM
PHPRunner General questions
S
swanside author

I have a login table which holds users email addresses called login and the field is email
I have a table called book where registared people from my family can put photos in.
I want to be able to email everybody in the login table, email field when a new photo is added.
How can this happen?
Thanks
Paul.

J
Jepsen 2/8/2009

I have done it this way.
Every time a new record is added to my database.
Add event after records add:

$getmail_query = mysql_query("SELECT * FROM _nyhedsbreve WHERE id = last_insert_id();") or die(mysql_error());

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

$subject = $row['Subject'];

$message = $row['melding'];

$getaddresses_query = mysql_query("SELECT * FROM _adgangsregister") or die(mysql_error());

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

if ($row['nyhedsbrev'] == TRUE) {

$to = $row['e_mail'];

@mail($to, $subject, $message, "From: nyheder@vaabenhistoriskselskab.dk");

}

}

}


I get the last record in "_nyhedsbreve" and sent it to everyone in "_adgangsregister" if "they have ticked off "nyhedsbrev"

S
swanside author 2/12/2009

Thanks, I tried it, by editing some of the code, but it wont work for me.
All I want to do is when somebody posts a new picture in my database using the field of pic_id, I want to send an email to all registared users in the login table>Email field saying new picture uploaded.
Thanks

Paul

N
nicolagrimshaw 2/17/2009

I am looking for something very similar. I want to send emails to all property owners (by type), for example all those who own 4 bedroom villas, when a customer completes and enquiry form. Have you progressed any further with this?
Kind regards
Nicola

N
nicolagrimshaw 2/17/2009

I am looking for something very similar. I want to send emails to all property owners (by type), for example all those who own 4 bedroom villas, when a customer completes and enquiry form. Have you progressed any further with this?

Kind regards
Nicola


I have found a way round what I want to do which might help... It involves setting up another table and manually putting in email addresses at the moment, although I'm trying to find a way of populating this in another post see http://www.asprunner.com/forums/index.php?showtopic=10712