I have to build a site that will have about a million (they think/hope) users every day. The site will have to email each user with the results from the days competition and their answers so each one will need to be different. The data will come from a SQL Server database.

I can build the site ok but my problem occurs with the emails. Ideally the emails would be sent at night but this would require a) scheduled asp processing which I'm not sure about and b) potentially millions of emails needing to be sent at around the same time.

If anyone has any thoughts/suggestions/help/examples etc I'd be very grateful! Lots of points available to good suggestions. I can increase the points if required.

Please post comments only (not answers), and I'll select your comment as an answer if its useful!

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You can use CDONTS object to send emails to these users. You will just read a record about appropriate user. Anyway here are a few links that might help you get started.
mkill22Author Commented:
Thanks, I should have said, I am familiar with sending emails from asp but I am concerned with the amount of emails and scheduling the sending of them.
If the way you say they going to have milion of users it might take a long time sending them. I was working on the project where we had an online store. We had to send the people emails when seomethign was wrong witht their info. Sometimes it took most of the night.
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

I have a web app where I'm doing some email notification at timed intervals.  It's not the high volume that you're dealing with, however.

I created an NT Service with Visual Basic by using ntsvc.ocx which is an unsupported ocx distributed on MSDN.  This gives you a true NT Service, not a vb app pretending to be a service (i.e. srvany.exe).

Once you create the basic shell for the service, you can use whatever method you like (cdonts, etc) for actually sending the emails.

I don't know if this VB Service is as robust as one created in C++, but it certainly speeds the development time.  I'd be willing to share some code if you're interested, but you can also get a good sample from the MSDN Article where you download the service.

If you put some flags in your database to indicate send success, you could also run the service on several machines to speed the process.
I have a solution.

Have a table called "Emails". Put all the email information into this table like "To, from, cc, Subj, Body". Have a vb application running in the background which is always looking for new emails in this table. When ever a new eamil record in put, the application picks it up mails it accordingly and removes it from the table. This can work very well for even a high traffic/load site. May be u can consider making this VB application an NT-Service also.

Hope it was satisfactory.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mkill22Author Commented:

I have not experience with NT service or using .ocx but am interested in learning!
1. Download the MSDN article and get the ocx.

2.  Create a VB exe project and drop the ocx on your form.

3.  Put this code in your form load event.  I hope it's not too messed up from being pasted into this little box! :-}

Private Sub Form_Load()
Dim strDisplayName As String

On Error GoTo Err_load
'uncomment this for debugging
'NTService.Debug = True
strDisplayName = NTService.DisplayName
If Command = "-install" Then
NTService.Interactive = True
If NTService.Install Then          
MsgBox strDisplayName & " installed successfully"
MsgBox strDisplayName & " failed to install"
End If
ElseIf Command = "-uninstall" Then
If NTService.Uninstall Then
MsgBox strDisplayName & " uninstalled successfully "
MsgBox strDisplayName & " failed to uninstall"
End If
Unload Me
ElseIf Command = "-debug" Then
NTService.Debug = True
ElseIf Command <> "" Then
MsgBox "Invalid command option"
End If
' set service only to start and stop
NTService.ControlsAccepted = svcCtrlStartStop
' connect service to Windows NT 'services controller
Exit Sub
ServiceLog ("Error in FormLoad. [" & Err.Number & "] " & _
End Sub

4.  Then drop a timer object on your form and put some "action" code in the timer event.

5.  Compile the exe.  To install it on NT server or workstation, do
name.exe -install

6.  Then look in control panel services, and you'll see your service.

7.  Click start and watch the fireworks.

8.  Remember not to do anything visual with your app (e.g. msgbox).  All errors use the "servicelog" function, which writes to the NTEventLog.

Public Sub ServiceLog(strMessage As String)
   Call main.NTService.LogEvent(svcEventError, _
      svcMessageError, strMessage)
End Sub

It's tricky getting it to work properly, but once you get the kinks worked out it's real slick.  Make sure you get the MSDN article because it has complete documentation for the ocx ... a lot more helpful than my little blurbs here.


It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.