Jump to content

emailing each record of database


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
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');

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Are you sure you have something important to add to it?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • 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.