Outlook Search Folder ‘Mail With Attachments’ Excludes Inline Images: Fix
🔍 WiseChecker

Outlook Search Folder ‘Mail With Attachments’ Excludes Inline Images: Fix

Your Outlook Search Folder named “Mail With Attachments” may not show messages that contain inline images embedded in the email body. This happens because Outlook distinguishes between files attached to a message and images inserted inline using the tag. This article explains why the built-in Search Folder excludes inline images and provides a method to create a custom Search Folder that includes both attached files and inline images.

The root cause is that the Search Folder filter uses the “Has Attachments” condition, which only checks for entries in the attachment table of the message. Inline images are stored as part of the message body, not as separate attachment entries, so they do not trigger the condition. You will learn how to build a custom Search Folder using the “Message Contains” condition to capture inline images.

This fix works on all current versions of Outlook for Microsoft 365, Outlook 2021, Outlook 2019, and Outlook 2016. No third-party tools are required. You can complete the entire process in under five minutes.

Key Takeaways: Fixing the Outlook “Mail With Attachments” Search Folder for Inline Images

  • Folder > New Search Folder > Custom > Choose: Create a custom Search Folder with a manual query instead of using the built-in template.
  • Search Folder Criteria > Messages > More Choices > Has Attachments: The built-in condition that excludes inline images because they are not stored as separate attachments.
  • Condition: “message:irmessages:irmage” in the Search Folder query: A custom Advanced Find condition that matches messages containing inline image references in the body.

ADVERTISEMENT

Why the Built-in “Mail With Attachments” Search Folder Excludes Inline Images

Outlook stores inline images differently from file attachments. When you insert a picture directly into the email body using Insert > Pictures, Outlook embeds the image as binary data inside the HTML body of the message. The image is referenced by a Content-ID (CID) tag in the HTML source. It is not listed in the message’s attachment table, which is the data structure that Outlook queries for the “Has Attachments” condition.

The built-in Search Folder named “Mail With Attachments” applies the following filter:

urn:schemas:httpmail:hasattachment = 1

This condition returns TRUE only when the message has at least one entry in the attachment table. Inline images do not create such entries. Therefore, any message that contains only inline images and no attached files will not appear in that Search Folder. Messages that have both an attached file and an inline image will appear, but the user cannot rely on the Search Folder to find messages with inline images alone.

Outlook does not provide a built-in Search Folder template that includes inline images. The workaround is to create a custom Search Folder with an Advanced Find query that searches the message body for image references. This method captures both attached files and inline images in a single folder.

Steps to Create a Custom Search Folder That Includes Inline Images

  1. Open the Folder pane and select Search Folders
    Press Ctrl+6 to display the Folder pane in the navigation bar. Scroll down to the Search Folders section. If you do not see Search Folders, right-click the folder list header and select Folders to enable the full folder hierarchy.
  2. Start a new Search Folder
    Go to Folder > New Search Folder. In the dialog box that opens, scroll to the bottom of the list and select Create a custom Search Folder. Click the Choose button.
  3. Name the Search Folder and open the criteria
    In the Custom Search Folder dialog, type a name such as “Mail with Attachments or Inline Images”. Click the Criteria button to open the Search Folder Criteria dialog.
  4. Set the Has Attachments condition for file attachments
    In the Search Folder Criteria dialog, go to the Messages tab. Check the box labeled Only items with: and select one or more attachments from the dropdown list. This condition catches all messages that have at least one file attached. Do not close this dialog yet.
  5. Add an Advanced condition for inline images
    Click the Advanced tab. Click the Field button, select Frequently-used fields, and then select Message Body. In the Condition dropdown, select contains. In the Value field, type irmage. Click Add to List. This condition searches for the string “irmage” which is part of the HTML tag used by Outlook when embedding inline images. The full tag is <img src="cid:...">, and the substring “irmage” appears in every such tag.
  6. Set the logical operator to OR
    By default, multiple conditions are joined with AND. You need OR so that a message qualifies if it has an attachment OR contains an inline image. In the Advanced tab, click the Group button and select OR. The condition list should now show two groups: the Has Attachments condition from the Messages tab and the Message Body contains “irmage” condition from the Advanced tab, joined by OR.
  7. Save the Search Folder
    Click OK in the Search Folder Criteria dialog. Click OK in the Custom Search Folder dialog. Click OK in the New Search Folder dialog. Outlook builds the Search Folder immediately. You will see all messages that have file attachments, inline images, or both.

Alternative Method: Use the “irmages” Query with Instant Search

If you prefer not to create a permanent Search Folder, you can use Instant Search to find inline images on the fly. Click in the Search box at the top of the message list and type:

body:irmage

This query searches the message body for the substring “irmage” and returns all messages with inline images. To also include file attachments, add the following to the search query:

hasattachments:yes OR body:irmage

This Instant Search query works for a one-time search but does not persist like a Search Folder.

ADVERTISEMENT

If the Custom Search Folder Still Misses Some Messages

Messages with inline images sent from other email clients

The substring “irmage” is specific to Outlook. If you receive a message from Gmail, Apple Mail, or another client that embeds inline images using a different HTML structure, the word “irmage” may not appear in the message body. In that case, the custom Search Folder will not catch those messages. To broaden the search, add additional conditions for common image-related substrings such as src="cid or image/jpeg. Go back to the Advanced tab in the Search Folder Criteria and add each new condition under the OR group.

Messages with inline images that were saved and reopened

When you save a draft message that contains inline images and reopen it, Outlook may re-encode the image references. The substring “irmage” may change to a different internal identifier. In this case, the Search Folder may miss that specific message. To work around this, open the saved draft, right-click the inline image, and select Save As to save the image to your desktop. Then attach the saved file to the message. The message will now appear in the Search Folder through the Has Attachments condition.

Messages with only linked images (not embedded)

If the sender inserted images by linking to an external URL rather than embedding them, the message body contains an img tag with an src attribute pointing to a web address. These messages do not contain the substring “irmage” and do not have attachments. The custom Search Folder will not catch them. To find such messages, use the Instant Search query body:http and manually filter for image URLs.

Item Built-in “Mail With Attachments” Search Folder Custom Search Folder with Inline Image Condition
Description Uses the Has Attachments condition to find messages with file attachments Uses Has Attachments OR body contains “irmage” to find messages with file attachments or inline images
Inline images captured No Yes, for Outlook-sent messages
File attachments captured Yes Yes
Setup time One click via Folder > New Search Folder About 2 minutes using Criteria dialog
Maintenance None May need to add conditions for non-Outlook clients

The built-in Search Folder “Mail With Attachments” is convenient but incomplete for users who frequently receive or send inline images. By creating a custom Search Folder with an Advanced Find condition for the substring “irmage”, you can capture messages with embedded images that Outlook otherwise ignores. The same technique can be extended with additional conditions to cover images from other email clients. For a quick one-time search, use the Instant Search query body:irmage instead of creating a permanent folder.

ADVERTISEMENT