Programatically sending email to names in a database

Discussion in 'Databases' started by timfoster, Jun 13, 2005.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hi wintertract,

    We do this a lot from our site www.safeguardyourcar.com. the code you need is:


     
  2. Query the database and get the email addresses that you want to send to in a DataReader. I don't do MySql, but something on the order of:
     
  3. I've asked a variation of this question before, so please bear with me.

    I need specific information on how to take email addresses that are stored in a database and send an email to each name.

    Allow me to elaborate....

    Let's say I have fiveemail addressesstored in a database. With the click of one button, I need to
    1.)query the database (I'm using MySQL, but advice from anyone would be helpful!)
    2.)collect all the email addresses
    3.)send the same email to each name individually (to avoid any spam filters as these emails are requested by the receivers.)
    i.e., send email to address #1
    send same email to address #2
    send same email to address #3....(etc.)

    I think this all involves Do...Loops, but I have zero experience using them. Can someone help put me on the right track?

    I guess my biggest question is once I've queried the database for the email addresses, how do I format the code to make the email send to each name individually?

    Thanks in advance!

    Steph
     
  4. Thanks Scott & Tim for responding... :eek:)
    I've tried running the code Scott gave me. It's successfully sending the email to the first name in the database, but no others. Can you help me figure out why? Here's my code.
     
  5. The whhile loop to read email addresses and send looks fine.

    Silly question, but is there more than one valid email address in the test table to send to?
     
  6. Yep. To test, I'm using my personal email addresses.
     
  7. Only other suggestion I have is to put your DASP domain on the safe list for the email
    providers you are testing with.

    Or check to see if the emails are going to your junk or spam folders. I don't know if it
    is still the case but e-mail from DASP accounts to Hotmail used to wind up in the junk
    folder.
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page