473,320 Members | 1,865 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 1380

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

Similar topics

1
by: mhawkins19 | last post by:
I have a form built and on the onclick event I validate all of the fields and then if the form is ok, on the submit event I run a javascript function to set a cookie and download a file from the...
9
by: Bob Jones | last post by:
We have developed a commercial ASP.net application (personal nutrition management and tracking); we want to send smtp email from within it. For our development box, we use WinXP Pro, IIS 5.5,...
1
by: Quentin Huo | last post by:
Hi: I tried to send email from an ASP.NET page through SMTP. But I always got the error: Server Error in '/' Application....
2
by: Ron | last post by:
hi guys, I am trying to send email using smtpMail. I can send emails inside the organization, but out of the organization I get an error "The server rejected one or more recipient addresses. The...
3
by: Gerard | last post by:
Hello I have created a windows service to monitor a database, it starts some checks when a timer elapses. The checks send emails depending on their findings. My issue is that when I created a...
2
by: ucasesoftware | last post by:
i start a process to send email via Outlook I have succes to build the email text, objet, sender... but i want to automate the "send"... i don't want my users to click on Send email button......
3
by: =?Utf-8?B?SHVnaA==?= | last post by:
Hi There, I use follow code to send email inside VB.NET 2005. It does not work well. Error message of "Failure sending email" would occue. However, email was sent out sometimes. I am confused...
16
by: =?Utf-8?B?Q2hlZg==?= | last post by:
I can use outlook2003 to send email,but I cann't use this code below to send email. Please help me to test this code and instruct me how to solve this problem in detail. software...
0
by: Chan Chi Man | last post by:
Hello all, I am using ASP + CDO tp send mail (running on Win2000 server and will not upgrade to use ASPX in 2 years time). I use ASP + CDO to send email with Chinese To:, From:, Subject: and...
4
by: dfluker | last post by:
This form will not send the email to my account and I used other forms to submit emails using examples that I googled but I can't get this form to process the request. Can someone tell me what i'm...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.