For some reasons, you may save many draft emails in your Outlook. This article will teach you how to batch send all of them or just selected ones via one click, which is created with Outlook VBA.
Sometimes, you may not hope to send out the emails right now. Therefore, you’ll save them in the Drafts mail folder and intend to send out them later. As usual, when you want to send out the drafts, you have to open them individually and hit “Send” button one by one. If there are a great amount of drafts to be sent, it’ll be quite time-consuming. Hence, many users hope that Outlook can permit them to send out all the drafts just by clicking one button. However, by default, there isn’t such a button. But you can apply Outlook VBA to create it. Here are the elaborate steps and VBA codes.
Batch Send All Draft Emails
- At first, launch Outlook application and press “Alt + F11” shortcuts.
- Then you will open the VBA editor window, in which you should open a new module.
- Subsequently, copy and paste the following VBA codes into it.
Sub SendAllDraftEmails() Dim objDrafts As Outlook.Items Dim objDraft As Object Dim strPrompt As String Dim nResponse As Integer Dim i As Long Set objDrafts = Outlook.Application.Session.GetDefaultFolder(olFolderDrafts).Items If objDrafts.Count > o Then strPrompt = "Are you sure to send out all the drafts?" nResponse = MsgBox(strPrompt, vbQuestion + vbYesNo, "Confirm Sending") If nResponse = vbYes Then For i = objDrafts.Count To 1 Step -1 objDrafts.Item(i).Send Next End If Else MsgBox ("No Drafts!") End If End Sub
- After that, you can exit the VBA editor and proceed to add the VBA project to Quick Access Toolbar or ribbon. Here we will take Quick Access Toolbar as an example.
- Firstly, go to “File” > “Options” > “Quick Access Toolbar” tab.
- Then follow the steps shown in the picture below to add the new macro to Quick Access Toolbar.
- Finally you can back to main Outlook window. You will see the new button in Quick Access Toolbar.
- If there is no item in the Drafts folder, when you click the button, you will receive a message like the following screenshot.
- But if there are items in the Drafts folder, you will receive a prompt, like the image below. As soon as you select “Yes”, Outlook will begin to send out all the drafts.
Batch Send Selected Draft Emails
If you hope to send the selected drafts only, then the above codes are unsuitable. You can use the following codes instead.
- Firstly, copy them into a new module.
Sub SendSelectedDraftEmails() Dim objSelection As Selection Dim strPrompt As String Dim nResponse As Integer Dim i As Long Set objSelection = Outlook.Application.ActiveExplorer.Selection If objSelection.Count > 0 Then strPrompt = "Are you sure to send out the selected " & objSelection.Count & " draft item(s)?" nResponse = MsgBox(strPrompt, vbQuestion + vbYesNo, "Confirm Sending") If nResponse = vbYes Then For i = objSelection.Count To 1 Step -1 objSelection.Item(i).Send Next End If Else MsgBox ("No items selected!") End If End Sub
- Then add the new macro to Quick Access Toolbar as usual.
- Subsequently, you can select the target draft emails and hit the button, you will get a prompt like the image:
- Finally, as long as you click “Yes”, the selected draft emails will be sent out.
Dispose of Annoying Outlook Problems
Perhaps you have encountered multiple vexing Outlook issues. How can you get rid of them? As usual, you can try its inbuilt repair tool, Scanpst.exe. It is able to fix the small Outlook PST file issues. But if you unfortunately meet up with severe troubles, such as PST email damage, the inbox tool will not make effects. At that point, you have no choice but to employ a more preeminent tool, like DataNumen Outlook Repair.
Author Introduction:
Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including mdf error repair and outlook repair software products. For more information visit www.datanumen.com
Hola, he localizado vuestro código, porque tengo que enviar correos desde borradores, seleccionando el/los correos que quiero que se envíen. Pero me da error la maceo en:
objSelection.Item (i) .Send
La verdad, no se como arreglarlo. ¿Me podéis ayudar?
Muchas gracias
This is great, but is it possible to stagger the sending of the individual emails by inserting a delay of xxx seconds in between each message being sent. I want to do this so the mail server does not interpret the bulk statements I send as spam mail and decline the sending op.
I absolutely love this code and it works perfectly. My only issue is that the draft emails I prepare have the salutation “Good Morning / Afternoon / Evening”.
I have seen code that will automate the insertion of that salutation but only at the point the draft is created.
Is there any code I could add to the above that would check the time the email is being sent and add the correct salutation at that point?