MS OUTLOOK Bulk Mailing stalling after 2 minutes (1 Viewer)

ajetrumpet

Banned
Local time
Today, 07:12
Joined
Jun 22, 2007
Messages
5,638
all,

i am trying to send a bulk mailing out through outlook, and i am getting stuck after a certain period of time of sending. here is my code for the loop:
Code:
Function sendall()

'Creates a new e-mail item and modifies its properties

    Dim oNS As Object
    Dim oContacts As Object
    Dim oContactItem As ContactItem
    Dim objMail As MailItem
    Set oNS = Application.GetNamespace("MAPI")
    Set oContacts = oNS.Folders(1).Folders("Contacts")

For Each oContactItem In oContacts.Items
   If oContactItem.CompanyName = "temp" Then
      Set objMail = Application.CreateItem(olMailItem)
         With objMail
            'Set body format to HTML
            .To = oContactItem.Email1Address
            .Subject = "TEST MESSAGE FROM " & oContactItem.FullName
            .BodyFormat = olFormatHTML
            .HTMLBody = "<HTML><BODY>THIS IS A TEST MESSAGE FROM " & _ 
                                      oContactItem.FullName & "</BODY></HTML>"
            '.Display
            .Send
         End With
   End If
Next

Set oContactItem = Nothing
Set oContacts = Nothing
Set oNS = Nothing
Set objMail = Nothing

End Function
these message will send right away if i specify to "send immediately on connect" in the email options. if i don't send immediately, they pile up in the outbox and sit there. either way is fine with me, but my outlook is stalling on the send process at message #85 if i send say, 250 messages out. it always stalls around that spot. i tried placing a fake 5 second "pause" code snippet after the .send action to give outlook some time to complete the current sending before moving on to the next, but that stalls out at the same place as well. the code i tried is this:
Code:
               'PauseTime = 5
               'Start = Timer
                  'Do While Timer < Start + PauseTime
                     'DoEvents
                  'Loop
i am looking for some pointers in the right direction here as to how to solve this problem. i would appreciate any help that you all could give me on this one. thanks!
 

RainLover

VIP From a land downunder
Local time
Today, 22:12
Joined
Jan 5, 2009
Messages
5,041
Not sure but it could have something to do with limits placed upon you by your ISP.
 

ajetrumpet

Banned
Local time
Today, 07:12
Joined
Jun 22, 2007
Messages
5,638
limits in a certain time period? if i send the mailing out in batches of 50 messages each, it doesn't stall until the 4th batch of 50, then it stalls on message #38. <laughs>

i'll check into it though with my ISP. thanks
 

Atomic Shrimp

Humanoid lifeform
Local time
Today, 13:12
Joined
Jun 16, 2000
Messages
1,954
I agree - it sounds exactly like something an ISP might implement to prevent bulk mailing.

It might help if you insert some recipient-specific text (such as the customer's name) in the subject and/or body - your ISP's mail server might just be restricting you on the number of identical messages you can send - or maybe not - it might be smarter than that.

One possible workaround would be to implement a local SMTP server, but this again could be dependent on your ISP permitting you to use the right TCP port(s).
 

Users who are viewing this thread

Top Bottom