AtTips, Tricks & Tools
for Microsoft® Office Outlook®

Green arrowBuy an Upgrade now

Deutsch
Tips Programming E-Mail remains in the outbox

E-Mail remains in the outbox

Some times e-mails will not be send and remains in the outbox. One reason could be the virus scanner which occurs some problems or e-mails was draged from the drafts folder to the outbox.

To use this example please read the important notes and have a look to the workshop Use VBA in Outlook®. Please insert this code into a new module (Insert -> Module in the VBA-Editor).

For Outlook® 2000, Outlook® 2002, Outlook® 2003, Outlook® 2007

Option Explicit
 
Public Sub FlushOutBox()
 
    '====================================================================================
    ' Sends the items in the outbox
    ' (c) Peter Marchert - http://www.outlook-stuff.com
    ' 2008-11-02 Version 1.0.0
    '====================================================================================
 
    Dim objOutbox As Outlook.MAPIFolder
    Dim objItem As Outlook.MailItem
    Dim lngItems As Long
 
    On Error Resume Next
 
    '------------------------------------------------------------------------------------
    ' Reference the outbox
    '------------------------------------------------------------------------------------
    Set objOutbox = Outlook.Session.GetDefaultFolder(olFolderOutbox)
 
    '------------------------------------------------------------------------------------
    ' Send all items in the outbox
    '------------------------------------------------------------------------------------
    For lngItems = objOutbox.Items.Count To 1 Step -1
        Set objItem = objOutbox.Items(lngItems)
        objItem.Send
    Next
 
    '------------------------------------------------------------------------------------
    ' Delete references
    '------------------------------------------------------------------------------------
    Set objOutbox = Nothing
    Set objItem = Nothing
 
End Sub

Newsletter

NewsletterSorry, the Newsletter Service from outlook-stuff.com is currently only available in German. If you are nevertheless interested you may translate them with an online translation service.

Cart

Your cart is empty
Show the product page...

Product State

Updates

Report a bug

On this page you have a bug:

Newsflash

New tool to manage attachments published

On November the 4th 2009 the tool AttachmentsManager was published.

 Read more...

Lifetime Updates incl.!

Yes, it is really true: In outlook-stuff.com, you pay not a penny extra for updates!
Lifetime Updates incl.!

Pay once = use forever!

to the Shop...

Product Range

Close