?
Solved

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

Posted on 2005-04-01
11
Medium Priority
?
176 Views
Last Modified: 2010-04-08
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
0
Comment
Question by:ETMIS
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
11 Comments
 
LVL 76

Expert Comment

by:David Lee
ID: 13681057
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
 
LVL 74

Expert Comment

by:Jeffrey Kane - TechSoEasy
ID: 13688394
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
 

Author Comment

by:ETMIS
ID: 13704901
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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 76

Expert Comment

by:David Lee
ID: 13705131
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
 
LVL 74

Accepted Solution

by:
Jeffrey Kane - TechSoEasy earned 2000 total points
ID: 13705743
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
 

Author Comment

by:ETMIS
ID: 13706888
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
 
LVL 74

Expert Comment

by:Jeffrey Kane - TechSoEasy
ID: 13713112
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
 

Author Comment

by:ETMIS
ID: 13713895
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
 
LVL 74

Expert Comment

by:Jeffrey Kane - TechSoEasy
ID: 13746451
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

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you troubleshoot Outlook for clients, you may want to know a bit more about the OST file before doing your next job. IMAP can cause a lot of drama if removed in the accounts without backing up.
In this article I discuss my selections of the Top Four free Outlook OST File Viewers available. Open, view and read even damaged OST files by using these tools. They all provide a clear preview of all data such as emails, notes, tasks, calendars, e…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question