By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,868 Members | 1,974 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,868 IT Pros & Developers. It's quick & easy.

send email issue

P: 2
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
Share this question for a faster answer!
Share on Google+

Post your reply

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