View Full Version : MS OUTLOOK Bulk Mailing stalling after 2 minutes


ajetrumpet
07-25-2009, 08:34 PM
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: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 Functionthese 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:
'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
07-26-2009, 01:50 AM
Not sure but it could have something to do with limits placed upon you by your ISP.

ajetrumpet
07-26-2009, 05:08 PM
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
07-27-2009, 12:59 AM
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).