We help IT Professionals succeed at work.
Get Started

Sending email using CDO from VB6 app is slow

2,202 Views
Last Modified: 2011-03-01
I have a simple VB6 app that uses CDO to send email.  It's worked perfectly for the past 2 years.  A few days ago, it began having  speed issues.  Rather than sending multiple emails in less than a second, it now takes 5-10 seconds to send a single email.  The code hangs on the .Send command.
To my knowledge, there have been no changes made to our network over the past week.  I've checked patch logs, asked if anyone made any Group Policy changes, software installs - nothing changed recently.  
The .send command works, but way too slow.
Any ideas here?
Dim Cdo2Configuration As cdo.Configuration
    Dim Cdo2Message As cdo.Message
    Dim Cdo2Fields As ADODB.Fields
    
    Set Cdo2Configuration = New cdo.Configuration
    Set Cdo2Fields = Cdo2Configuration.Fields
    With Cdo2Fields
      .Item(cdoSMTPServer) = "Exchange_Server_Name"
      .Item(cdoSendUsingMethod) = cdoSendUsingPort
      .Item(cdoSMTPConnectionTimeout) = 15
      .Update ' Important
    End With
    
    ' Create a new message.
    Set Cdo2Message = New cdo.Message
    
    ' Set the message's configuration.
    Set Cdo2Message.Configuration = Cdo2Configuration
    
    ' Set the message content.
    Cdo2Message.Subject = sSubject
    Cdo2Message.TextBody = sBody
    Cdo2Message.HTMLBody = sHtmlBody
    
    ' Address the message.
    Cdo2Message.Sender = sSender
    Cdo2Message.From = sSender
    Cdo2Message.To = sTo
 
    ' Send the message.
    Cdo2Message.Send
    
    Set Cdo2Message = Nothing
    Set Cdo2Configuration = Nothing
    Set Cdo2Fields = Nothing

Open in new window

Comment
Watch Question
This problem has been solved!
Unlock 1 Answer and 7 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE