background:
The email address is stored in the MSSQL user information table with tens of thousands.
The company has its own servers, collecting SMTP, POP3, WWW, FTP, MSSQL, DNS and other services.
Jmail has a Mailmerge object, but the free version cannot be used
Require:
Use ASP JMAIL, use the company SMTP to send email to all users
Idea:
Reading the database directly and sending multiple cycles many times will cause a lot of pressure on the server with a low configuration.
It is best to send it in batches to Email, and each batch of sending interval for a period of time to alleviate the pressure on the server.
accomplish:
Batch on Email
Read the record to recordset and use the common paging program to make all the record pages. Each page is used as a batch.
Delay
After the execution of each page is completed, <meta http-equiv = refresh content = 60; url = sendmail.asp? Page = & page>
Reduce execution time:
During the cycle, add the recipient to the cycle instead of the circulation, that is,
for i = 1 to rs.pageSize
msg.addRecipient RS (email)
rs.movenext
next
msg.send (smtp.abc.com)
Reduce email size
If you add a recipient to the cycle, there will be a lot of email recipients, and such an email will be very large.
Therefore, improve it on the basis of the above code, make a judgment in the cycle, when the number of recipient email reaches
Send it once in 20. Right now:
for i = 1 to rs.pageSize
MSG.Addrecipient RS (Email)
If I MOD 20 = 0 THEN 'Send an email every 20 creditors as an email
msg.send (smtp.abc.com)
msg.ClearRrecipients' Clear the sender who has been sent
end if
rs.movenext
next
msg.send (smtp.abc.com) 'to send the remaining ones
page
Mail.asp contains mail themes and text forms, <FORM ACTION = Sendmail.asp Target = Send>; a iframe page, <iframe name = Send SRC = Sendmail.asp>
Sendmail.asp contains background sending programs, cycles, delayed jumps, etc.
shortcoming:
During the sending process, you cannot leave this page
The sending time is long, which is related to the performance of each batch of settings, network bandwidth, and SMTP server performance
improve:
You can include multiple iframe pages in Mail.asp. Each page starts from different PAGE, which is equivalent to multi -threaded sending.
The pressure on the SMTP server will increase, but it can shorten the delivery time.
You can consider using different SMTP servers in different Page, such as containing multiple iframe pages.
smtp.abc.com, use smtp.123.com on the odd number page. This not only reduces the pressure of the server, but also achieves multi -threaded sending
Shorten the purpose of the delivery time.