Outlook Auto Reply to Specific Domain? How-To
In this article
- How Auto-Reply Rules Work in Outlook
- Method 1: Desktop Outlook (Windows or Mac) – Rule with Template
- Method 2: Outlook on the Web (OWA) – Inbox Rule with Custom Action
- Method 3: Using a VBA Script (Advanced, Desktop Only)
- What About the “Automatic Replies” (Out-of-Office) Feature?
- Common Problems and Fixes
- Frequently Asked Questions
Yes, you can set Outlook to auto-reply only to emails from a specific domain, but the method depends on whether you use the classic desktop app or Outlook on the web. In the desktop app, you use a rule with a template; in Outlook on the web, you use an inbox rule with a custom message. This article walks through both approaches, explains the limitations, and answers common questions.
How Auto-Reply Rules Work in Outlook
Outlook's built-in automatic replies (the ones under File > Automatic Replies or the Settings > Automatic replies menu) apply to all senders or only to people in your contacts. They do not let you filter by domain. To target a specific domain like @example.com, you must create an Inbox Rule that triggers on the sender's address and then performs a custom action. The rule can either send a template reply (desktop) or run a script (web), but the underlying logic is the same: Outlook checks the incoming message's sender domain and, if it matches, sends a predefined response.
Method 1: Desktop Outlook (Windows or Mac) – Rule with Template
This works in Outlook 2016, 2019, 2021, and Microsoft 365 desktop versions. The key is to create a template file (.oft) first, then attach it to a rule.
- Create a new email message, type your reply text, then go to File > Save As and choose Outlook Template (*.oft). Name it something like
DomainReply.oft. - Go to File > Manage Rules & Alerts (or Rules > Manage Rules on Mac).
- Click New Rule.
- Choose Apply rule on messages I receive.
- Under Conditions, select with specific words in the sender's address. In the edit box, type the domain exactly like
@example.com(include the @ symbol). - Under Actions, select reply using a specific template and browse to the
.oftfile you created. - Finish the rule and enable it.
Important: The rule only fires when Outlook is running. If you close Outlook, no replies are sent. Also, the rule applies to new messages arriving after the rule is created; it does not retroactively reply to existing emails.
Method 2: Outlook on the Web (OWA) – Inbox Rule with Custom Action
Outlook on the web (the browser version) does not support templates, but it has a built-in action called “Reply with a custom message” that does exactly what you need.
- Go to Settings > Mail > Rules (or gear icon > View all Outlook settings > Mail > Rules).
- Click Add new rule.
- Name the rule (e.g., “Auto-reply to specific domain”).
- Under Conditions, choose From and then “From” contains. Type the domain like
@example.com. - Under Actions, choose “Reply with a custom message” and type your reply text.
- Click Save.
This rule works even when your browser is closed, because it runs on the server (Microsoft 365 or Exchange Online). However, it only works if your mailbox is hosted on Exchange Online or Microsoft 365 – not on a free Outlook.com account (free accounts do not support custom reply actions).
Method 3: Using a VBA Script (Advanced, Desktop Only)
If you need more control (e.g., reply only once per sender, or include the original subject), you can use a VBA macro. This is not for beginners, but it is a legitimate option.
- Press Alt+F11 in Outlook to open the VBA editor.
- Insert a new module and paste code that uses the
Application_NewMailExevent to check the sender domain and callReply. - You must enable macros in Outlook's Trust Center, and the macro will only run while Outlook is open.
VBA is powerful but can break with updates and is not supported by Microsoft. Most users should stick to the template or OWA rule.
What About the “Automatic Replies” (Out-of-Office) Feature?
Many people try to use the standard automatic replies (Out-of-Office) and are confused why they cannot filter by domain. The built-in feature only offers two options:
- Send replies to anyone – all senders get the reply.
- Send replies only to senders in my Contacts – only contacts get the reply.
There is no domain filter. That is why you need a rule. If you use both the automatic reply and a rule, the rule will take precedence for matching messages, but you may end up with double replies if you are not careful. It is best to turn off the standard automatic reply when using a domain-specific rule.
Common Problems and Fixes
- Rule does not fire: Check that the condition uses
@domain.comwith the @ symbol. Also verify the rule is enabled and that you are not also running a “stop processing more rules” action that blocks it. - Replies go to spam: Some email servers mark auto-replies as spam if they are sent too quickly. Adding a delay (like a few minutes) in the rule can help, but Outlook rules do not have a built-in delay. You would need a VBA script or a third-party tool.
- Duplicate replies: If you have both a rule and an automatic reply enabled, disable the automatic reply for the domain you are targeting.
- Outlook not running (desktop): The rule only works when Outlook is open. If you need 24/7 replies, use the OWA rule (server-side) instead.
- OWA rule missing “Reply with custom message”: This action is only available for Microsoft 365 or Exchange Online mailboxes. If you have a free Outlook.com account, you cannot use it. You could instead forward the message to another account that has the rule, but that is clunky.
Frequently Asked Questions
Can I set a different auto-reply for each domain?
Yes. Create a separate rule for each domain, each with its own template or custom message. In desktop Outlook, you need a separate .oft file for each reply. In OWA, you can create multiple rules with different conditions and custom messages.
Will the auto-reply go to the sender only once?
By default, Outlook rules reply to every message that matches the condition. If a sender emails you three times, they get three replies. To limit it to once per sender, you would need a VBA script that tracks senders, or you can use the “except if it is in the following categories” condition – but that is not a built-in deduplication.
Does the rule work on emails sent to a distribution group I am a member of?
Yes, if the message arrives in your Inbox and the sender matches the domain, the rule will fire. However, if you are a member of a group and the message is delivered to the group's mailbox (not yours), the rule will not see it.
Can I use this to auto-reply to external domains only (not my own company)?
Yes. Just set the condition to @external.com and add an exception for your own domain (e.g., except if the sender's address contains @mycompany.com). In desktop Outlook, you can add multiple conditions and exceptions.
Will the auto-reply include the original message?
No. The template or custom message is a fixed text. If you want to include the original message, you would need to create a template that includes the original text, but Outlook does not automatically insert it. A VBA script could do that, but it is not simple.
Is there a way to auto-reply only to emails from a specific domain and only during business hours?
Yes. In desktop Outlook, you can add a condition like “received in a specific date span” or “received between specific times” to the rule. In OWA, you can add a condition for the date range, but not for time of day. For time-based, you would need to enable/disable the rule manually or use a VBA script.