468,512 Members | 1,502 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,512 developers. It's quick & easy.

send email issue

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

Expand|Select|Wrap|Line Numbers
  1. dim cdoConfig
  2. Set cdoConfig = CreateObject("CDO.Configuration") 
  3. With cdoConfig.Fields  
  4.         .Item(cdosmtpserverport) = 26
  5.         .Item(cdoSendUsingMethod) = 2
  6.         .Item(cdoSMTPServer) = smtpserver
  7.         .Item(cdoSMTPAuthenticate) = 1  
  8.         .Item(cdoSendUsername) = musername
  9.         .Item(cdoSendPassword) = mpassword
  10.         .Update  
  11.     End With 
  12. dim cdoMessage            
  13.  
  14. do while not Tonews.eof
  15.     Set cdoMessage = CreateObject("CDO.Message")  
  16.  
  17.     With cdoMessage 
  18.         Set .Configuration = cdoConfig 
  19.         .From =  "raport@iisconsult.ro"
  20.         .To = Tonews("email")
  21.         .Subject = Session("title")        
  22.         .HTMLBody = msg
  23.          if  Session("attach") <> "" then 
  24.           .AddAttachment  "D:\Inetpub\wwwroot\iis2\upload" &  Session("attach") 
  25.  end if
  26.  
  27. .Send 
  28.      End With  
  29.    Set cdoMessage = Nothing  
  30.     Tonews.MoveNext 
  31. loop
  32.  
  33.     Set cdoConfig = Nothing 
  34.  
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.
May 12 '11 #1
0 1299

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

9 posts views Thread by Bob Jones | last post: by
1 post views Thread by Quentin Huo | last post: by
2 posts views Thread by Ron | last post: by
2 posts views Thread by ucasesoftware | last post: by
3 posts views Thread by =?Utf-8?B?SHVnaA==?= | last post: by
16 posts views Thread by =?Utf-8?B?Q2hlZg==?= | last post: by
reply views Thread by Chan Chi Man | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.