Print Page | Close Window

send email issue

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=29319
Printed Date: 28 March 2026 at 4:08am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: send email issue
Posted By: radujit
Subject: send email issue
Date Posted: 12 May 2011 at 7:37pm

Hi,
I have this newsletter code, that takes emails from the recordset Tonews and sends a specific message + attach

dim cdoConfig
Set cdoConfig = CreateObject("CDO.Configuration")
With cdoConfig.Fields 
        .Item(cdosmtpserverport) = 26
        .Item(cdoSendUsingMethod) = 2
        .Item(cdoSMTPServer) = smtpserver
        .Item(cdoSMTPAuthenticate) = 1 
        .Item(cdoSendUsername) = musername
        .Item(cdoSendPassword) = mpassword
        .Update 
    End With
dim cdoMessage   

do while not Tonews.eof
    Set cdoMessage = CreateObject("CDO.Message") 
 
    With cdoMessage
        Set .Configuration = cdoConfig
        .From =  " mailto:ra@iisconsult.ro - raport@iisconsult.ro"
  .To = Tonews("email")
  .Subject = Session("title")  
        .HTMLBody = msg
         if  Session("attach") <> "" then
    .AddAttachment  "D:\Inetpub\wwwroot\iis2\upload" &  Session("attach")
 end if
  
.Send
     End With 
   Set cdoMessage = Nothing 
    Tonews.MoveNext
loop

    Set cdoConfig = Nothing

Everything works fine, except that the email is transmitted twice to each receipient.

So I would like to help modify my code so that:
1. send message only once
2. split the recordset considering the following mail server restrictions:
- A mail box can't send more that 50 emails within 10 minutes.
- A mail box can' send an email to more that 30 recipients in each sending process.
- if are more than 1000 messages sent to swith to another account.

Thank you.




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net