Australian cloud for business software — built and run in Sydney since 2002

NetLeverage
NetLeverage

Outlook warning: "A program is trying to send an e-mail message on your behalf" when another program sends mail

Technical article
Troubleshooting

About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.

A user clicks a send or email button in Microsoft Excel, an accounting package or another business application. Instead of the mail going out, Outlook shows a security warning: "A program is trying to send an e-mail message on your behalf. If this is unexpected, click Deny and verify your antivirus software is up-to-date."

Microsoft's page for this message gives one cause, the way Outlook decides to show it, and two ways to resolve it. The first is to put the antivirus status right. The second is a registry value that tells Outlook when to warn, and one of its three settings turns the warning off completely.

Everything before the Fix section only reads. The second fix lowers a security protection, so it is written with the care that deserves.

What the error means

The page says that when you send an email message from another program, such as Microsoft Excel, in Outlook LTSC 2021, Outlook 2019, Outlook for Microsoft 365, Outlook 2016 or Outlook 2013, you receive this warning:

A program is trying to send an e-mail message on your behalf. If this is unexpected, click Deny and verify your antivirus software is up-to-date.

The cause, in Microsoft's words: "This warning message is displayed when a program tries to access your Outlook client to send an email message on your behalf, and your antivirus software is detected to be inactive or out-of-date."

Two things follow from that sentence. The warning is not an error in Outlook or in the sending program; it is a protection that reacts when Outlook cannot see a valid antivirus product. And the page's own wording says the antivirus software is "detected" to be inactive or out of date, so the fault may be in what Outlook detects as much as in the antivirus product. The page does not say how Outlook detects antivirus status beyond the Trust Center display described below.

Likely causes

Cause What you see How to confirm
The antivirus product is inactive or out of date The warning on each send from another program; Programmatic Access shows a status other than Valid File, Options, Trust Center, Trust Center Settings, Programmatic Access; read the Antivirus status line
Outlook does not detect a valid antivirus product, whatever the reason The same warning, with a status other than Valid Same screen; the page's route is to enable or update the program until the status is Valid
The behaviour was set by the ObjectModelGuard value The warning appears every time, or never, regardless of antivirus status The registry value under the Outlook Security key, read only
An unexpected program is sending mail The program named by the user is not one that should send mail The message's own wording: "click Deny" if it is unexpected (our reading that this is a cause; the page's cause is the antivirus status)

The page gives no counts, so the rows are not in order of likelihood. The last row matters. The warning is a defence: if nobody expects mail to be sent, the right answer is Deny and a check of what ran.

Prove the cause before changing anything

All of these read only.

  1. Identify what triggered the warning. Ask the user which program they were using and what they clicked. If the answer is that they did nothing, do not continue: the message itself says to click Deny when it is unexpected, and an unexpected sender is a security question, not a configuration fault.

  2. Read Outlook's view of the antivirus. The page gives these steps: in Outlook, select File, then Options. Select Trust Center, then Trust Center Settings. Select Programmatic Access. View the Antivirus status information listed in the window. The page says that if the status is anything other than Valid, the next step is to enable or update the antivirus program.

  3. Check the registry value, read only, if the machine has been tuned before. The page says the value is called ObjectModelGuard and lives under an Outlook Security key whose path depends on the Office and Windows bitness:

  • 32-bit Office on 64-bit Windows: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Office\<x.0>\Outlook\Security
  • 32-bit Office on 32-bit Windows, or 64-bit Office on 64-bit Windows: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\<x.0>\Outlook\Security

In both paths <x.0> stands for the Office version. The page says 16.0 is Office 2016, Office 2019, Office LTSC 2021 or Outlook for Microsoft 365, and 15.0 is Office 2013. If ObjectModelGuard already exists, write down its data. If the Security key does not exist, nothing has been set there.

  1. Compare. The three possible values on the page are:
  • 0, "Warn me about suspicious activity when my antivirus software is inactive or out-of-date (recommended)".
  • 1, "Always warn me about suspicious activity".
  • 2, "Never warn me about suspicious activity (not recommended)".

If a value of 1 is set, Outlook will warn every time, whatever the antivirus status. If the value is 2 and the warning still appears, the page does not cover that case.

Example (illustrative): a firm in Adelaide runs a stock report in Excel that emails the result through Outlook. reports-pc02 shows the warning on every send. Programmatic Access reports an antivirus status that is not Valid, and the security product's service is stopped. That matches Microsoft's stated cause, so the first fix applies, not the registry.

Fix

Use Method 1 first. The page lists it first, and it fixes the cause rather than the symptom.

Method 1: make the antivirus status Valid

Disruptive step: The next step enables or updates the antivirus program on this computer. Enabling or updating a security product can restart its services or ask for a restart of the computer, and the page gives no steps because they belong to the product's vendor.

Write down the Antivirus status text shown under Programmatic Access, so you can show that it changed.

Follow the antivirus vendor's own steps to enable or update the program, until Programmatic Access shows Valid.

To undo it: Microsoft's page gives no steps to reverse this, and an enabled and current antivirus program is the state the page wants. If an update causes a fault, take that to the antivirus vendor.

Method 2: change the ObjectModelGuard value

Risk: The next steps change a security setting in the Windows registry for Outlook. With the value set to 2, Outlook never warns when a program tries to send mail through it, so mail sent by an unexpected program would go out without the warning. Registry edits made in error can also cause problems that Microsoft's page does not describe.

This is a registry change that decides when Outlook warns. Value 2 turns the warning off for every program, and Microsoft labels that setting "not recommended". Choose it only when a person responsible for security has agreed, and consider value 0 first: it is the setting the page marks as recommended and it keeps the warning for the case where antivirus status is not valid.

Before you change it, save the key. Microsoft's registry page says: in Registry Editor, locate and click the key you want to back up, select File, then Export, choose a location and a file name, and select Save. If the Security key or the value does not exist yet, there is nothing to export; the way back in that case is to delete what you create.

  1. Select Start and enter regedit. Right-click Registry Editor in the search results and select Run as administrator.
  2. Go to the Security key that matches the bitness, from the list above. If the key is not present, right-click the last subkey in the path, select New, then Key, and create it.
  3. Right-click the subkey, select New, then DWORD, and name it ObjectModelGuard.
  4. Set the value to 0, 1 or 2 as agreed.
  5. Exit Registry Editor.

After you update the registry, the page says to check Outlook: select File, then Options, then Trust Center, then Trust Center Settings, then Programmatic Access, and check that the change is shown correctly. The page's example screenshot shows the "Never warn me about suspicious activity (not recommended)" option selected after setting value 2.

To undo it: if you exported the key first, import that file in Registry Editor with File, then Import. If the value did not exist before, delete the ObjectModelGuard value you created, or set it to 0, the setting the page marks as recommended. The page does not say what Outlook does when the value is absent.

Confirm the fix

  • The next send from the other program completes without the warning, or, for value 0, the warning is gone because Programmatic Access now shows Valid.
  • Programmatic Access shows the status you expect: Valid after Method 1, or the selected option after Method 2.
  • The user can still be warned when needed. After Method 2, a value of 2 means they will not be.
  • The ticket records the Antivirus status text before and after, and the ObjectModelGuard value before and after.

What to watch afterwards

  • Antivirus status after updates and restarts. The page's cause is a product detected as inactive or out of date, so a product that stops updating can bring the warning back.
  • Computers where the value is 2. The page marks that setting not recommended; record which machines have it and who agreed.
  • Unexpected senders. The warning is the page's own signal for an unexpected program, so a new program that triggers it deserves a question, not an exemption.
  • Office version moves. The page treats 15.0 and 16.0 as the two key names; check the current page when a new Office build appears.

Risks and limits

These steps have not been run or lab-tested.

Method 2 lowers or removes a security warning. The page's value descriptions are the only statement of the effect. The page does not say how Outlook detects antivirus status except by showing it under Programmatic Access, does not explain what happens on a computer with no antivirus product, and gives no range of Office builds beyond the versions in its Applies-to line. It describes the registry change for the local machine under HKEY_LOCAL_MACHINE and gives no guidance for managing the value across many computers. Microsoft's pages give no counts for how many cases each cause covers.

Sources