Skip to main content

How to get warning when sending email to external domain in Outlook?

Author Siluvia Last modified

Sending emails to external domains (e.g., outside your organization) can sometimes lead to accidental data leaks or security risks. To prevent this, you can set up a warning in Outlook that alerts you before sending emails to external recipients. In this tutorial, I’ll walk you through two methods to achieve this.

Using Outlook’s Built-In MailTips Feature

Using VBA Code


Using Outlook’s Built-In MailTips Feature

The "The following recipient is outside your organization" warning in Outlook is a helpful feature designed to alert users when they are sending emails to external recipients. This feature, part of MailTips, was introduced in Microsoft Outlook 2010 and is available for users connected to a Microsoft Exchange Server. Below is a step-by-step guide on how this feature works and how to manage it.

How It Works

When composing an email, Outlook automatically checks if the recipient's domain is external.

If the recipient is outside your organization, a warning message ("The following recipient is outside your organization") appears below the recipient field.

doc-warning-when-sending-email-to-external-domain-1

This reminder helps users double-check before sending sensitive information to external parties.

How to Enable the Feature

The "Recipient Outside Your Organization" warning is typically enabled by default for Outlook accounts connected to Exchange Server. However, if it’s not working, follow these steps:

  1. Ensure you are using Outlook 2010 or later.
  2. Confirm that your account is connected to a Microsoft Exchange Server.
  3. The MailTips feature is configured on the Exchange Server. If the warning is not appearing, ask your IT administrator to enable MailTips for your organization.
Limitations
  • This feature is only available for Outlook accounts connected to Exchange Server.It does not work for personal email accounts (e.g., Outlook.com, Gmail, or POP/IMAP accounts).
  • End-users cannot customize or enable/disable this feature directly in Outlook. It must be managed by the IT administrator.

Using VBA Code

The following VBA code can help you get warning when sending email to external domain in Outlook. Please do as follows.

1. Press the Alt + F11 keys to open the Microsoft Visual Basic for Applications window.

2. In the Microsoft Visual Basic for Applications window, double click ThisOutlookSession to open the ThisOutlookSession (Code) window, and then copy below VBA code into the window. See screenshot:

VBA code: Get warning when sending email to external domain

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
'Update by Extendoffice 20180504
Dim xMailItem As Outlook.MailItem
Dim xRecipients As Outlook.Recipients
Dim i As Long
Dim xRecipientAddress As String
Dim xPrompt As String
Dim xYesNo As Integer
Dim xPos As Integer
On Error Resume Next
If Item.Class <> olMail Then Exit Sub
Set xMailItem = Item
Set xRecipients = xMailItem.Recipients
For i = xRecipients.Count To 1 Step -1
    xRecipientAddress = xRecipients.Item(i).Address
    xPos = InStrRev(LCase(xRecipientAddress), "@addin99.com")
    If xPos <= 0 Then Exit For
    Cancel = False
Next
If InStrRev(LCase(xRecipientAddress), "@addin99.com") > 0 Then Exit Sub
xPrompt = "Are you sure to send this email to outside your company? "
xYesNo = MsgBox(xPrompt, vbYesNo + vbQuestion, "Kutools for Outlook")
If xYesNo = vbNo Then Cancel = True
End Sub

Note: In the code, “@addin99.com” is the internal email domain you will send emails to. Please change it as you need.

doc-warning-when-sending-email-to-external-domain-1

From now on, when clicking Send button to send emails to external email domain (not the internal email domain you specified in the VBA code), a warning box will pop up as below screenshot shown.

doc-warning-when-sending-email-to-external-domain-2

AI Mail Assistant in Outlook: Smarter Replies, Clearer Communication (one-click magic!) FREE

Streamline your daily Outlook tasks with the AI Mail Assistant from Kutools for Outlook. This powerful tool learns from your past emails to offer intelligent and accurate responses, optimize your email content, and help you draft and refine messages effortlessly.
doc ai email handle

This feature supports:

  • Smart Replies: Get responses crafted from your past conversations—tailored, precise, and ready to go.
  • Enhanced Content: Automatically refine your email text for clarity and impact.
  • Effortless Composition: Just provide keywords, and let AI handle the rest, with multiple writing styles.
  • Intelligent Extensions: Expand your thoughts with context-aware suggestions.
  • Summarization: Get concise overviews of long emails instantly.
  • Global Reach: Translate your emails into any language with ease.

This feature supports:

  • Smart email replies
  • Optimized content
  • Keyword-based drafts
  • Intelligent content extension
  • Email summarization
  • Multi-language translation

Best of all, this feature is completely free forever! Don’t wait—download AI Mail Assistant now and enjoy!


Related articles:

Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more
Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!