Group Emails using Vb.Net

I am somewhat new to designing .net applications. If someone can give guidance, would appreciate. I am trying to build a process where a user may enter on a web form various criterias that will pull data in from oracle db. Matching emails will be stored into a "job" that will sit on some scheduled server and have a separate process actually send out the emails. I'm sure there are many ways to go about this.
[412 byte] By [techie3] at [2008-1-13]
# 1
Hi,

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

Vikram at 2007-8-21 > top of Msdn Tech,.NET Development,.NET Framework Networking and Communication...
# 2
In .NET Framework 2.0 System.Web.Mail will be replaced bySystem.Net.Mail, which includes drop folder support. Using System.Net.Mail you can send emails to the IIS drop folder and have IIS send out the emails for you. The code looks like this:



MailMessage message = new MailMessage(from, to, subject, body);
SmtpClient client = new SmtpClient(smtpServername);
client.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis;
client.Send(message);

Daniel Roth
System.Net

DanielRoth at 2007-8-21 > top of Msdn Tech,.NET Development,.NET Framework Networking and Communication...
# 3
Will IIS be able to handle 10,000 emails? I will have a 'job' that will be waiting to be processed. When processed there will be up to about 10,000 individual emails that need to be sent out.
techie3 at 2007-8-21 > top of Msdn Tech,.NET Development,.NET Framework Networking and Communication...
# 4
Hi,

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

Vikram at 2007-8-21 > top of Msdn Tech,.NET Development,.NET Framework Networking and Communication...
# 5

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.

techie3 at 2007-8-21 > top of Msdn Tech,.NET Development,.NET Framework Networking and Communication...
# 6
I'm having trouble figuring out 2 issues with the new 'System.Net.Mail' class.
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'.
2. How to add attachments?
Thanks
Sh Fog
shfoggy at 2007-8-21 > top of Msdn Tech,.NET Development,.NET Framework Networking and Communication...
# 7
These are based on Beta2 API

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");

mahjayar at 2007-8-21 > top of Msdn Tech,.NET Development,.NET Framework Networking and Communication...
# 8
I am looking to use Web services to create email records in SQL database. These email records may or may not contain attachments. How are attachments stored in SQL Server database .... what kind of field type stored they be stored as?
techie3 at 2007-8-21 > top of Msdn Tech,.NET Development,.NET Framework Networking and Communication...
# 9
Vikram,
I've written a windows service that consumes a webservice to get the details of emails that have to be sent, just as you described. The timer event fires and sends emails using the System.Web.Mail class - but it only works for email recipients that are on the home domain. If the recipient is from an external perimeter I get the following error message..
Could not access 'CDO.Message' object.
Do I have to change something on our mail server? Any ideas.
Regards
Herbert
HerbertHerbert at 2007-8-21 > top of Msdn Tech,.NET Development,.NET Framework Networking and Communication...

.NET Development

Site Classified