Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2003
    Posts
    2

    Unanswered: Sending a batch of e-mails

    Is it possible to use DTS to send a batch of e-mails out based on a query condition?

    I have a Users table with details such as UserName, EMail_Address, SendEmail etc. What I want is for my query to check the field called 'SendEmail' to see if it is True, and if so send a an email with an attachment to the email address in the field 'EMail_Address' for that person, and so on for every user in the table.

    I don't have much experience with DTS and I've never used the Send Mail Task, so any advice would be really appreciated.

    Cheers,

    Mike

  2. #2
    Join Date
    Jun 2002
    Location
    Singapore
    Posts
    71

    Re: Sending a batch of e-mails

    Originally posted by mikep72
    Is it possible to use DTS to send a batch of e-mails out based on a query condition?

    I have a Users table with details such as UserName, EMail_Address, SendEmail etc. What I want is for my query to check the field called 'SendEmail' to see if it is True, and if so send a an email with an attachment to the email address in the field 'EMail_Address' for that person, and so on for every user in the table.

    I don't have much experience with DTS and I've never used the Send Mail Task, so any advice would be really appreciated.

    Cheers,

    Mike
    Hello Mike.

    I have recently worked on sending email from SQL but not as complicated as yours. Mine doesn't query on userID to select the recipients.

    Found this on the web but not sure if it helps.

    http://www.databasejournal.com/sqletc/print.php/1585201[/url]


    All the best.

    Best regards
    Teck Boon

  3. #3
    Join Date
    Mar 2003
    Location
    Reading, UK
    Posts
    70

    Re: Sending a batch of e-mails

    why dont u try using xp_sendmail property available in sql server

    pavan

  4. #4
    Join Date
    Mar 2003
    Posts
    2

    Re: Sending a batch of e-mails

    I've managed to get around this by writing a VB module using CDONTS and running the exe through SQL Server.

    Mike

  5. #5
    Join Date
    Mar 2003
    Location
    Reading, UK
    Posts
    70

    Re: Sending a batch of e-mails

    when ur mail addresses r in a table and u r sending them by checking a condition the best option would be to use xp_sendmail with some condition with the required parameters and then send the mail.

    1.create a temp table with required fields
    2.execute xp_sendmail using ur own stored proc.
    3.Mail Profile setting is rqd. to be done before doing this.(set them in control panel)
    4.start ur sql mail session.
    5.execute the proc.

    I think there is no need to use CDONTS for this.

    if any changes pl. inform me

    regards
    pavan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •