Posted on 2000-02-07
Medium Priority
Last Modified: 2008-03-10
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!

Question by:mkill22
  • 2
  • 2
  • 2
  • +1

Expert Comment

ID: 2496741
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.


Author Comment

ID: 2496785
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.

Expert Comment

ID: 2496825
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.
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.


Expert Comment

ID: 2497200
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.

Accepted Solution

Sachin_svk earned 400 total points
ID: 2499412
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.

Author Comment

ID: 2499425

I have not experience with NT service or using .ocx but am interested in learning!

Expert Comment

ID: 2500391
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.



Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
There is a wide range of advantages associated with the use of ASP.NET. This is why this programming framework is used to create excellent enterprise-class websites, technologies, and web applications.
How to fix display issue, screen flickering issue when I plug in power cord to the machine. Before I start explaining the solution lets check out once the issue how it looks like after I connect the power cord. most of you also have faced this…
The video provides a quick and easy steps to migrate MBOX file to well known Outlook PST and Office 365. Besides this, it also supports and migrates more than 20 email clients of MBOX which include AppleMail, Opera, Thunderbird and SeaMonkey effortl…
Suggested Courses

599 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question