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 = "firstname.lastname@example.org" .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.