How to get Mail on Mac to send pdfs and pictures as attachments

Start writing a new letter in Mail on Mac OS (Big Sur, Catalina or even earlier). Drag an image file or pdf to the e-mail and it will end up – usually in any case – embedded in the e-mail so that the content is visible. It can be practical at times, but it can also help. Like when you, for example, want to add several large images and do not want the email to be filled in by the images, but that these should instead be as downloadable attachments.

Another example is if you are trying to email an invoice, application form or something else and the recipient has asked you to leave the message blank. This is usually due to such emails being read in by a robot, much like some authorities have reading centers where letters and documents are digitized. If the message has any content, the email is sorted so that a person must read it, even if only the code places the image.

Other email programs like Outlook make it easy to switch between embedded and clean attachments, but Apple Mail has no setting for that. In any case, not visible. But if you dare to open Terminal and enter a command, you can still fix it.

Terminal command

To turn off embedded attachments, use this command:

defaults write com.apple.mail DisableInlineAttachmentViewing -bool YES

And to activate it again:

defaults write com.apple.mail DisableInlineAttachmentViewing -bool NO

Previously, you had to restart Mail for the setting to be available, but when we test in both Catalina and Big Sur, it works immediately.

Premium – create a shortcut

If you often need to switch between embedded and loose attachments, it may be worth creating a shortcut that does it for you, so you do not have to open the terminal every time. There are several methods, the easiest being to save the following script as a file with an appropriate name and the extension .sh, which you then activate with one of the many programs that can run command prompt scripts via shortcut. Examples are Keyboard Maestro, Alfred, Launchbar and Better Touch Tool.

The script:

#!/bin/bash
if [ '1' = $(defaults read com.apple.mail DisableInlineAttachmentViewing) ]
then
defaults write com.apple.mail DisableInlineAttachmentViewing -bool NO
elif [ '0' = $(defaults read com.apple.mail DisableInlineAttachmentViewing) ]
then
defaults write com.apple.mail DisableInlineAttachmentViewing -bool YES
fi

This toggles on and off, so a shortcut is enough.

If you do not have a separate program, you can also create a workflow in Automator and then add a keyboard shortcut to System Settings -> Keyboard -> Keyboard Shortcuts to run it. However, it can be much slower.