• Outlook User
  • New Outlook app
  • Outlook.com
  • Outlook Mac
  • Outlook & iCloud
  • Developer
  • Microsoft 365 Admin
    • Common Problems
    • Microsoft 365
    • Outlook BCM
    • Utilities & Addins

Delay Delivery of Messages Sent at Specific Times

Slipstick Systems

› Developer › Code Samples › Delay Delivery of Messages Sent at Specific Times

Last reviewed on February 13, 2018     55 Comments

An Outlook user, KT, wanted to defer delivery of messages sent after 6PM, sending them at 7 AM the next day. This is possible to do using an ItemSend macro.
defer messages

If it's after 6PM or before 7AM, the message is held until 7AM, then sent. Because this is an Outlook script, it only works in Outlook. It will not affect messages sent using smartphones or other devices.

"Set a default 'Do not Deliver before' time" and "To delay sending a message in Outlook"

May 6 2017: Edited the macros to properly move early morning messages ahead a few hours, not 1 day and to account for messages sent Sat or Sun.

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)

' If after 6PM
  If Now() > DateSerial(Year(Now), Month(Now), Day(Now)) + #5:59:00 PM# Then
    SendAt = DateSerial(Year(Now), Month(Now), Day(Now) + 1) + #7:00:00 AM#
' If before 7AM
  ElseIf Now() < DateSerial(Year(Now), Month(Now), Day(Now)) + #6:59:00 AM# Then
    SendAt = DateSerial(Year(Now), Month(Now), Day(Now)) + #7:00:00 AM#
  End If
 Item.DeferredDeliveryTime = SendAt

End Sub

If you need to skip weekends (or other days of the week), check the name of the day and add additional time to the SendAt time.

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim dayname As String

' If after 6PM
  If Now() > DateSerial(Year(Now), Month(Now), Day(Now)) + #5:59:00 PM# Then
    sendat = DateSerial(Year(Now), Month(Now), Day(Now) + 1) + #7:00:00 AM#
' If before 7AM
  ElseIf Now() < DateSerial(Year(Now), Month(Now), Day(Now)) + #6:59:00 AM# Then
    sendat = DateSerial(Year(Now), Month(Now), Day(Now)) + #7:00:00 AM#
' We'll test the date of all messages
 ElseIf WeekdayName(Weekday(Now())) = "Saturday" Or WeekdayName(Weekday(Now())) = "Sunday" Then
   ' this will be changed by the next part if a weekend
   sendat = DateSerial(Year(Now), Month(Now), Day(Now)) + #11:00:00 PM#
 End If

dayname = WeekdayName(Weekday(sendat))

Select Case dayname
Case "Saturday"
    sendat = DateSerial(Year(Now), Month(Now), Day(Now) + 2) + #7:00:00 AM#
Case "Sunday"
    sendat = DateSerial(Year(Now), Month(Now), Day(Now) + 1) + #7:00:00 AM#
End Select
    Item.DeferredDeliveryTime = sendat
Debug.Print Now(), dayname, sendat

End Sub

Only Delay message Sent to Specific Addresses

Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)

Const PR_SMTP_ADDRESS As String = "http://schemas.microsoft.com/mapi/proptag/0x39FE001E"

Set recips = Item.Recipients
 For Each recip In recips
 Set pa = recip.PropertyAccessor
 
 Address = LCase(pa.GetProperty(PR_SMTP_ADDRESS))
 lLen = Len(Address) - InStrRev(Address, "@")

 Select Case Right(Address, lLen)
' add additional addresses as neeed, using quotes and comma separator
    Case "mcarnar@domain.com", "bburns@domain.com", "rchildars@domain.com", "curry@domain.com"
         
    Case Else ' remove case else line to be warned when sending to the addresses
     strMsg = strMsg & " " & Address & vbNewLine
 End Select
 Next

' using <> delays these addresses only; 
' use = to delay all but these addresses

If strMsg <> "" Then
' If after 6PM
  If Now() > DateSerial(Year(Now), Month(Now), Day(Now)) + #5:59:00 PM# Then
    SendAt = DateSerial(Year(Now), Month(Now), Day(Now) + 1) + #7:00:00 AM#
' If before 7AM
  ElseIf Now() < DateSerial(Year(Now), Month(Now), Day(Now)) + #6:59:00 AM# Then
    SendAt = DateSerial(Year(Now), Month(Now), Day(Now)) + #7:00:00 AM#
  End If
Item.DeferredDeliveryTime = SendAt
 
End If
End Sub

How to use the macro

First: You will need macro security set to low during testing.

To check your macro security in Outlook 2010 or 2013, go to File, Options, Trust Center and open Trust Center Settings, and change the Macro Settings. In Outlook 2007 and older, it’s at Tools, Macro Security. If Outlook tells you it needs to be restarted, close and reopen Outlook. Note: after you test the macro and see that it works, you can either leave macro security set to low or sign the macro.

Now open the VBA Editor by pressing Alt+F11 on your keyboard.

To use the macro code in ThisOutlookSession:

  1. Expand Project1 and double click on ThisOutlookSession.
  2. Copy then paste the macro into ThisOutlookSession. (Click within the code, Select All using Ctrl+A, Ctrl+C to copy, Ctrl+V to paste.)
    macro in the VBA editor

More information as well as screenshots are at How to use the VBA Editor.

Delay Delivery of Messages Sent at Specific Times was last modified: February 13th, 2018 by Diane Poremsky

Related Posts:

  • Set a default 'Do not Deliver before' time
  • Add Attachments and Set Email Fields During a Mail Merge
  • Create Outlook appointments using multiple recurring patterns
  • Create a deferred Birthday message for an Outlook Contact

About Diane Poremsky

A Microsoft Outlook Most Valuable Professional (MVP) since 1999, Diane is the author of several books, including Outlook 2013 Absolute Beginners Book. She also created video training CDs and online training classes for Microsoft Outlook. You can find her helping people online in Outlook Forums as well as in the Microsoft Answers and TechNet forums.

Subscribe
Notify of
55 Comments
newest
oldest most voted
Inline Feedbacks
View all comments

Victor Ivanidze (@guest_218958)
December 11, 2021 12:55 pm
#218958

There exists the add-in for Outlook named OffHours that ensures that emails you write after business hours and on weekends are delayed and will only be sent at the start of the next business day: https://www.ivasoft.com/offhoursaddin.shtml

Last edited 3 years ago by Victor Ivanidze
0
0
Reply
Adam (@guest_217420)
January 8, 2021 11:20 am
#217420

This is super - thank you so much! All our student email addresses start with "ST0000". I would like to delay delivery to students only between 3pm-8:30am and at weekends for any emails sent to to addresses beginning with/containing "ST0000". Would this be possible? My knowledge of VBA is relatively basic.

0
0
Reply
Ahmad Banki (@guest_217264)
December 7, 2020 2:10 am
#217264

Hi Diane & thanks a lot. Two questions:

  1. I tried the code for deferring the weekends, but it doesn't seem to work. I don't get an error message, but when I send something between 8AM-6PM on a weekend, it still gets sent.
  2. About the recipient not seeing the exact time when I wrote the message, you referred to https://www.slipstick.com/developer/send-email-outlook-reminders-fires/#draft, but is this something to do for every message separately? Or is there a universal formula which would apply to all message? Basically I want the time which appears on the message (to the recipient) to be the 7 AM as opposed to the evening/midnight!

Thanks again.

0
0
Reply
Diane Poremsky(@diane-poremsky)
Author
Reply to  Ahmad Banki
December 7, 2020 10:14 am
#217266

On the sent time macro - the one in your links sends all drafts when the reminder fires. I have similar macro that would sends drafts at different times. You put the time you want to send them messages in the subject and the macro runs on s schedule - anything with a date older than that will be sent when the macro runs.

This gives me an idea - instead of looking at the subject, add a defer until time and look at that in the draft. Off to find the macro and tweak it. :)

0
0
Reply
Jean-Marc (@guest_215902)
September 20, 2020 4:11 am
#215902

Thank you so much Diane. Your post did exactly what I needed.

It was a while since Dom asked two years ago about SendAt not being defined. The trick is to define SendAt like this:
Dim SendAt As Date

The problem is caused by Option Explicit at the top (which is a good idea and should not be removed according to me)

1
0
Reply
Evaristo (@guest_215657)
July 26, 2020 9:33 am
#215657

Would this be a good way to address the issues of sending e-mails on Friday and Saturday from 6PM to 11:59PM?

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim dayname As String
 
' If Friday after 6PM
If WeekdayName(Weekday(Now())) = "Friday" And Now() > DateSerial(Year(Now), Month(Now), Day(Now)) + #5:59:00 PM# Then
sendat = DateSerial(Year(Now), Month(Now), Day(Now) + 3) + #8:00:00 AM#
 
' If Saturday
ElseIf WeekdayName(Weekday(Now())) = "Saturday" Then
sendat = DateSerial(Year(Now), Month(Now), Day(Now) + 2) + #8:00:00 AM#
 
' If Sunday
ElseIf WeekdayName(Weekday(Now())) = "Sunday" Then
sendat = DateSerial(Year(Now), Month(Now), Day(Now) + 1) + #8:00:00 AM#
 
' If other week days after 6PM
 ElseIf Now() > DateSerial(Year(Now), Month(Now), Day(Now)) + #5:59:00 PM# Then
   sendat = DateSerial(Year(Now), Month(Now), Day(Now) + 1) + #8:00:00 AM#
' If other week days before 8AM
 ElseIf Now() < DateSerial(Year(Now), Month(Now), Day(Now)) + #7:59:00 AM# Then
   sendat = DateSerial(Year(Now), Month(Now), Day(Now)) + #8:00:00 AM#
End If
 
   Item.DeferredDeliveryTime = sendat
 
End Sub

0
0
Reply
Diane Poremsky(@diane-poremsky)
Author
Reply to  Evaristo
December 7, 2020 8:56 am
#217265

That should work. (I didn't test it though - but it looks good.)

1
0
Reply
Jaime Uribe (@guest_215259)
May 24, 2020 9:16 pm
#215259

Hi. It helped me a lot. Thank you

0
0
Reply
Jamie (@guest_215257)
May 23, 2020 9:11 am
#215257

Hi Diane, I am just starting out with Macros -- have never had to do this before. This is exactly what I am looking for. I'm using Outlook 2016. Even though I copy/paste this macro into ThisOutlookSession, when I hit play, it brings up the Macros dialog box (with run, cancel, step intro) and there is nothing to select there. I am missing a step somehow. What am I doing wrong?

0
0
Reply
Jamie (@guest_215258)
Reply to  Jamie
May 24, 2020 9:27 am
#215258

THis is my comment- Please reject it because it is awaiting moderation -- it seems to be working now -- I have a different question that I am going to post in your forums, which I just saw now.

0
0
Reply
Andi (@guest_214593)
January 12, 2020 2:42 am
#214593

Hi Diane,

Thanks a lot for the great article. It is a bit older, but I still have a question. I tried your macro and it works perfectly, but the time the email is sent is still the time when I hit send. Meaning the receipient sees the time when I actually sent the message. Is there a way to set the time displayed in the message header to match the time it actually leaves my outbox or at least when the timer expires?

Thanks a lot,

Best Regards
Andreas

0
0
Reply
Diane Poremsky(@diane-poremsky)
Author
Reply to  Andi
January 13, 2020 12:47 am
#214594

No, not using this method. If you use an appointment reminder to trigger the send, it will have the current time. The reminder will trigger a macro that sends a draft.

https://www.slipstick.com/developer/send-email-outlook-reminders-fires/#draft

0
0
Reply

Visit Slipstick Forums.
What's New at Slipstick.com

Latest EMO: Vol. 30 Issue 15

Subscribe to Exchange Messaging Outlook






Support Services

Do you need help setting up Outlook, moving your email to a new computer, migrating or configuring Office 365, or just need some one-on-one assistance?

Our Sponsors

CompanionLink
ReliefJet
  • Popular
  • Latest
  • Week Month All
  • Use Classic Outlook, not New Outlook
  • How to Remove the Primary Account from Outlook
  • Disable "Always ask before opening" Dialog
  • Adjusting Outlook's Zoom Setting in Email
  • This operation has been cancelled due to restrictions
  • Remove a password from an Outlook *.pst File
  • Reset the New Outlook Profile
  • Maximum number of Exchange accounts in an Outlook profile
  • Save Attachments to the Hard Drive
  • How to Hide or Delete Outlook's Default Folders
  • Google Workspace and Outlook with POP Mail
  • Import EML Files into New Outlook
  • Opening PST files in New Outlook
  • New Outlook: Show To, CC, BCC in Replies
  • Insert Word Document into Email using VBA
  • Delete Empty Folders using PowerShell
  • Warn Before Deleting a Contact
  • Classic Outlook is NOT Going Away in 2026
  • Use PowerShell to Delete Attachments
  • Remove RE:, FWD:, and Other Prefixes from Subject Line
Ajax spinner

Recent Bugs List

Microsoft keeps a running list of issues affecting recently released updates at Fixes or workarounds for recent issues in classic Outlook (Windows).

For new Outlook for Windows: Fixes or workarounds for recent issues in new Outlook for Windows .

Outlook for Mac Recent issues: Fixes or workarounds for recent issues in Outlook for Mac

Outlook.com Recent issues: Fixes or workarounds for recent issues on Outlook.com

Office Update History

Update history for supported Office versions is at Update history for Office

Outlook Suggestions and Feedback

Outlook Feedback covers Outlook as an email client, including Outlook Android, iOS, Mac, and Windows clients, as well as the browser extension (PWA) and Outlook on the web.

Outlook (new) Feedback. Use this for feedback and suggestions for Outlook (new).

Use Outlook.com Feedback for suggestions or feedback about Outlook.com accounts.

Other Microsoft 365 applications and services




New Outlook Articles

Google Workspace and Outlook with POP Mail

Import EML Files into New Outlook

Opening PST files in New Outlook

New Outlook: Show To, CC, BCC in Replies

Insert Word Document into Email using VBA

Delete Empty Folders using PowerShell

Warn Before Deleting a Contact

Classic Outlook is NOT Going Away in 2026

Use PowerShell to Delete Attachments

Remove RE:, FWD:, and Other Prefixes from Subject Line

Newest Code Samples

Insert Word Document into Email using VBA

Warn Before Deleting a Contact

Use PowerShell to Delete Attachments

Remove RE:, FWD:, and Other Prefixes from Subject Line

Change the Mailing Address Using PowerShell

Categorize @Mentioned Messages

Send an Email When You Open Outlook

Delete Old Calendar Events using VBA

Use PowerShell or VBA to get Outlook folder creation date

Rename Outlook Attachments

VBA Basics

How to use the VBA Editor

Work with open item or selected item

Working with All Items in a Folder or Selected Items

VBA and non-default Outlook Folders

Backup and save your Outlook VBA macros

Get text using Left, Right, Mid, Len, InStr

Using Arrays in Outlook macros

Use RegEx to extract message text

Paste clipboard contents

Windows Folder Picker

Custom Forms

Designing Microsoft Outlook Forms

Set a custom form as default

Developer Resources

Developer Resources

Developer Tools

VBOffice.net samples

SlovakTech.com

Outlook MVP David Lee

Repair PST

Convert an OST to PST

Repair damaged PST file

Repair large PST File

Remove password from PST

Merge Two Data Files

Sync & Share Outlook Data

  • Share Calendar & Contacts
  • Synchronize two computers
  • Sync Calendar and Contacts Using Outlook.com
  • Sync Outlook & Android Devices
  • Sync Google Calendar with Outlook
  • Access Folders in Other Users Mailboxes

Diane Poremsky [Outlook MVP]

Make a donation

Mail Tools

Sending and Retrieval Tools

Mass Mail Tools

Compose Tools

Duplicate Remover Tools

Mail Tools for Outlook

Online Services

Calendar Tools

Schedule Management

Calendar Printing Tools

Calendar Reminder Tools

Calendar Dates & Data

Time and Billing Tools

Meeting Productivity Tools

Duplicate Remover Tools

Productivity

Productivity Tools

Automatic Message Processing Tools

Special Function Automatic Processing Tools

Housekeeping and Message Management

Task Tools

Project and Business Management Tools

Choosing the Folder to Save a Sent Message In

Run Rules on messages after reading

Help & Suggestions

Submit Outlook Feature Requests

Slipstick Support Services

Buy Microsoft 365 Office Software and Services

Visit Slipstick Forums.

What's New at Slipstick.com

Home | Outlook User | Exchange Administrator | Office 365 | Outlook.com | Outlook Developer
Outlook for Mac | Common Problems | Utilities & Addins | Tutorials
Outlook & iCloud Issues | Outlook Apps
EMO Archives | About Slipstick | Slipstick Forums
Submit New or Updated Outlook and Exchange Server Utilities

Send comments using our Feedback page
Copyright © 2025 Slipstick Systems. All rights reserved.
Slipstick Systems is not affiliated with Microsoft Corporation.

wpDiscuz

Sign up for Exchange Messaging Outlook

Our weekly Outlook & Exchange newsletter (bi-weekly during the summer)






Please note: If you subscribed to Exchange Messaging Outlook before August 2019, please re-subscribe.

Never see this message again.

You are going to send email to

Move Comment