Click to See Complete Forum and Search --> : want to send emails within specific domains in vb.net


toton
April 26th, 2008, 05:07 AM
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:toton@xyz.com,toton1@abc.com,toton2@def.com 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.

Oblio
April 26th, 2008, 09:52 AM
how do you know which domains should/should not get email?

toton
April 27th, 2008, 02:13 AM
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......

dglienna
April 27th, 2008, 12:26 PM
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

sotoasty
April 27th, 2008, 05:01 PM
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.

toton
April 28th, 2008, 02:11 AM
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.