Error when sending more than 250 or so messages from a list of Contacts

I am trying to send a message (8k) to a list ofcontacts held in a Public Folder. I use the AdvancedSearch facility to select the list of recipients. All has worked fine until we move the mailbox from Exchange 5.5 to Exchange 2003: now, after about 250 messages sent I get the error 0x80004005 - Operation failed. I first thought it had to do with the PublicFolder but in fact it fails on the "oMessage.Copy" statement.

This is an extract of my code:

Sub App_AdvancedSearchComplete(SearchObject)
  Set oSearch = SearchObject
  Set oItems = oSearch.Results
  NumItems = oItems.Count

  On Error Resume Next
  For I = 1 To NumItems
    sName = Trim(Cstr(oItems(I).Email1Address))
    Set oMailMsg = oMessage.Copy
    With oMailMsg
      If Len(sName) > 0 Then
        Set oRecipient = .Recipients.Add(sName)
        oRecipient.Type = olTo
      End If
      If .Recipients.Count > 0 Then
        .DeleteAfterSubmit = True
        .Send
      Else
        .Delete
      End If
      If Err.Number = 0 Then
        LogInfo "Mail sent to    : " & sName
      Else
        .Delete
        LogInfo "Mail NOT sent to: " & oItems(I).FullName & " (Error:" & Hex(Err.Number) & " - " & Err.Description & ")"
        Err.Clear
      End If
    End With
    Set oRecipient = Nothing
    Set oMailMsg = Nothing
  Next

  bSearchComp = True 'this is the variable I test in the main loop to quit the program when all processing done.
End Sub

Any help will be greatly appreciated.

Dominique
ETMISAsked:
Who is Participating?
 
Jeffrey Kane - TechSoEasyConnect With a Mentor Principal ConsultantCommented:
ETMIS...

Just because you haev your own internal Exchange server does not mean that your ISP hasn't blocked port 25 outbound from your network.  You really should check with them.

Also... you didn't answer if Outlook is set as your DEFAULT mail client on the machine you are using?

Jeff
0
 
David LeeCommented:
Hi ETMIS,

I've never run into anything quite like this so I'm not certain what's going on.  I've not heard of any limit on the number of times an item can be copied.  Perhaps a test is in order.  Try something like this just to see if there is a limit on the number of times an item can be copied:

For x = 1 to 500
    Set oMailMsg = oMessage.Copy
Next

If that works, then we know it isn't a limit issue.  When the error occurs what happens if you use the debugger to look at oMessage?  

Cheers!
0
 
Jeffrey Kane - TechSoEasyPrincipal ConsultantCommented:
What version of Outlook are you using?  You really want to use Outlook 2003 w/Exchange 2003.  Also, make sure that Outlook is set as your default email client... that should clear up the error.  (Unless your ISP has restricted traffic flow on port 25 recently... lately, that seems to be an alternative to completely blocking the port).

Jeff @
TechSoEasy
0
Free tool for managing users' photos in Office 365

Easily upload multiple users’ photos to Office 365. Manage them with an intuitive GUI and use handy built-in cropping and resizing options. Link photos with users based on Azure AD attributes. Free tool!

 
ETMISAuthor Commented:
1. To BlueDevilFan: Everything works fine if I comment out the .Send and all messages are created if my Draft folder as expected. It is only when I actually send the messages that it fails.

2. To TechSoEasy: I am using Outlook 2003. We have our own internal Exchange server so no issue with our ISP.

After a few thoughts, it might well be to do with the fact that Outlook starts to receive too many NDRs as the contact list is not perfect ;-(((
0
 
David LeeCommented:
Ok, so we know it's not copying the message that's the problem.  It's something to do with sending.  I can't say this definitively, but I'd be surprised if it has anything to do with NDRs.  Are there any limits on your Exchange server that might be the culprit?  Trying to narrow this down further, could you try a test where you send a large number of messages to one known good internet address?
0
 
ETMISAuthor Commented:
If the problem was with the ISP all our Internet mail would be blocked. And . yes, Outlook if the default and only mail client.

I have tried to send the messages to my home address and it fails again after 247. In fact I was wrong, I have run it in the debugger and it fails on the Send.

Dominique
0
 
Jeffrey Kane - TechSoEasyPrincipal ConsultantCommented:
No, all your mail wouldn't be blocked if it was a "TRAFFIC FLOW" control which only allowed a maximum amount of messages per hour.

Why don't you try running the Exchange Best Practices Analyzer and see what it comes up with:  http://www.microsoft.com/exchange/downloads/2003/exbpa/default.mspx

Jeff
0
 
ETMISAuthor Commented:
Reread the initial post: it was working perfectly well with 5.5 and, by the way I sent all my 14000 messages last Friday by splitting in batch of 200 messages using Outlook. Since I have changed my method and I sent an other batch of 14000 messages yesterday using BLAT.

So the problem is between Outlook and Exchange. I don't want to hear anymore about my ISP (we process more than 1.5 millions messages per month). And we have run the BPA long time ago after the initial setup and again 2 weeks again when the new version was issued and all is clear.

Dominique
0
 
Jeffrey Kane - TechSoEasyPrincipal ConsultantCommented:
The only reason I brought up your ISP is because you didn't give reason for it to be eliminated as a problem... now that you have, I can cross that off the troubleshooting list.

As for your Exchange settings...

Open Exchange System Manager > DOMAINNAME > Servers > SERVERNAME > Protocols > SMTP > Default SMTP Virtual Server > Properties

On the General Tab > Limit number of Connections to: (I would keep this checked and keep the number at 500 but no more than 1000, depending on the resources available on your server).

On the Messages Tab > Limit number of messages per connection to:  (uncheck this box and you will resolve your problem).
0
All Courses

From novice to tech pro — start learning today.