Jump to content

emailing each record of database


phppup

Recommended Posts

I have a database with three fields: name, email, and event.  People signed on through a form and provided this information each time they wanted a ticket to attend Thanksgiving, Christmas, and New Years parties.

 

Now I want to contact them by email WITHOUT using a CC or BCC function because I do NOT want my messages filtered as spam.

 

How can I send each person a single email?

Link to comment
https://forums.phpfreaks.com/topic/250745-emailing-each-record-of-database/
Share on other sites

send an email for each iteration of the while loop...

this will take up many more resources than if you had used CC or BCC, someone else may know a better solution?

another option to deter spam filtering - send it via gmail's SMTP (if you've signed up to use google mail with your domain)

$sql=@mysql_query("SELECT name, email FROM people WHERE event='christmas'"); #whichever event
while ($row=mysql_fetch_assoc($sql)) {
mail($row['email'],'the subject','the message');
}

Some attendees submitted duplicate (but identical) information into the form in order to obtain more than one ticket, so they occuppy several record lines.  However, I only need to send ONE email to that person.  How can I filter through the records to make sure that only one email is sent even though the same email address may have been entered several times, so that I eliminate duplication?

 

In other words, to send ONE email to each UNIQUE address.

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.