CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2008
    Posts
    19

    Question want to send emails within specific domains in vb.net

    Hi,
    I have an application which sends emails for survey.These emails are coming from a particular table in database.Within that table email column consist several emails with different domains.
    Ex:[email protected],[email protected],[email protected] etc.
    now I have to send emails only in @xyz.com and @abc.com
    but not in the @def.com.
    Can any body help me in vb.net.

  2. #2
    Join Date
    Apr 2008
    Posts
    82

    Re: want to send emails within specific domains in vb.net

    how do you know which domains should/should not get email?

  3. #3
    Join Date
    Apr 2008
    Posts
    19

    Question Re: want to send emails within specific domains in vb.net

    thx for the reply....yes which domain i should sent and which is not that already mentioned in the requirment.....it is given to me......

  4. #4
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: want to send emails within specific domains in vb.net

    Do you have any code to start out with? If you have a list of addresses, then you have to read it into a stream, and load it into a list.
    You have to do the same with the list of domains NOT to send to.

    Then you can see if blacklisted-domain is a substring of the email address.

    If it's good, you send otherwise, you flag it
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  5. #5
    Join Date
    Sep 2000
    Location
    FL
    Posts
    1,452

    Re: want to send emails within specific domains in vb.net

    You say that the info is in a database. In that case, I suggest you filter the ones you need in your select statement.

    SELECT * FROM MyTableWithEmails WHERE EMailAddress LIKE '%abc.com' or EMailAddress LIKE '%def.com'

    This way, your recordset will only contain the records you need and you can send the emails 1 at a time.

  6. #6
    Join Date
    Apr 2008
    Posts
    19

    Re: want to send emails within specific domains in vb.net

    Thx a lot...I am trying to do this in select Query......but problem is that actually windows service sends this survey's every 4 hrs.I am little bit confuce about the testing of this process.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured