First, you will need to build this component that sends out emails as a Windows Service and a Timer Event to it so that it polls the database on regular intervals.
Second, depending on the nature of ur app, it maybe a good idea to wrap the DB with a webservice which will be consumed by this Windows Service.
I think if the logic is not very complicated, a single SQL Query should be able to retrieve the Email Ids which meet the criteria and this would be within the Web Service I mentioned above.
For actually sending out mails, the .NET Framework provides the System.Web.Mail class. Code sample in link below:
http://www.codeguru.com/columns/DotNet/article.php/c5467/
Regards,
Vikram
MailMessage message = new MailMessage(from, to, subject, body); SmtpClient client = new SmtpClient(smtpServername); client.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis; client.Send(message); |
Daniel Roth
System.Net
It should be able to handle that many. I would recommend that you schedule this processing to run at some time period when the load on ur site would be less.
Is it once per day or How often does this needs to run per day?
Also, make sure you add Thread.Sleep(0) within the loop in which u would send out these emails to ensure that the CPU does not spike to 100%.
Regards,
Vikram
Actually the user submitting the 'job' defines when it should be run. If all 10,000 emails need to be generated, then probably 1 or 2 'jobs' would be submitted. There may be a dedicated Exchange server to do this. So far my logic is the following:
1. User enters criterias on a web form to extract emails from oracle db and save
as a 'job'.
2. The 'job' would be saved for history purposes on a SQL server db
3. Windows Service (i'm a newbie to web services so not sure if I need
this process) will spool a certain number of emails out to Exchange
during the day until all emails are processed for that 'job'.
4. Will need some web interface so if user wants to see the email listing for
a specific 'job', allow for some sort of read to the SQL server db to get
the record. Maybe web service comes into play here. But could I just
write vb.net with SQL code to retrieve record back to the web page?
Thank you for your responses.
1. How to show nicknames in group emails. Like joe(joe@hotmail) so that only 'Joe' shows up in the recipient's email. The joe(joe@hotmail) format worked in 'System.Web.Mail' but doesn't seem to work with the 'System.Net.Mail'.
MailAddress ma = new MailAddress("joe@hotmail.com","DisplayName for Joe");
MailMessage.To.Add(ma);
2. How to add attachments
Attachment ath = new Attachment(FilenameAsString);
ath = Attachment.CreateAttachmentFromString("String");