tags:

views:

85

answers:

2

hai guys, Is there any mail queue concept in asp.net ... I want to send thousands of different mail to thousands of users (ie) each user will have a different mail ... I want send the mail on a particular time so that each user receives it at a constant time ......

+2  A: 

There really is not mail queue in the Core framework. You can send individual messages synchronously or asynchronously, but you can't really send a bunch at once.

You can queue your messages by storing them to a database or file server and then kicking off a job to loop through your saved messages and send them off.

Also, not all of your users will receive the messages at the same time, even if you could send them at the same time. There are too many external variables and dependencies (network traffic, mail server loads, spam filters) to accurately predicate when or even if your users receive their messages.

Jason
@Jason: Totally agree with you :) +1
o.k.w
Ok jason thanku for ur reply...
Pandiya Chendur
A: 

There's no native MailQueue concept within .NET framework. The queue will have to be implemented yourself. In your case, you would like the mails for each recipients to be sent at about the same time for all batches. Am I right?

Well, this is a bit tricky. You can use any SMTP server, localhost or external ones. But that also mean although you can dispatch to the SMTP server at a specific time, there's no guarantee it will reach the recipients immediately.

There are a whole bunch of stuff on mail delivery which are not exactly programming related (grey listing, spam filtering etc etc).

The alternative is to have full control on the sending and have your app directly sending the mails to the recipients' mail servers. Well that is workable and I suggest you use a commercial or a good open source component for that. Anyhow, there's still a whole bunch of issues you need to deal with, (e.g. some receiving mail server like Yahoo might block the sending a few times and let it through after a few retries).

I've posted a related question, take a look at the replies here.

o.k.w