Command Line Interface (emate)
MailMate includes a shell command named emate
which is located inside the MailMate application bundle. It can be used to create and, optionally, send emails directly from the command line.
It is recommended to make a symbolic link to emate
and never make a copy. This ensures that new versions of MailMate automatically updates the emate
command as well. Make sure ~/bin/
exists and paste the following in the Terminal:
mkdir -p ~/bin/
ln -s /Applications/MailMate.app/Contents/Resources/emate ~/bin/emate
This is the current output when running emate --help mailto
:
Create a new email using MailMate
Usage: emate mailto [OPTIONS] [attachments...]
Positionals:
attachments TEXT ... Files to attach
Options:
-h,--help Print this help message and exit
-f,--from TEXT ... Email address for the sender
-t,--to TEXT ... Email address to send to
-c,--cc TEXT ... Email addresses to add to cc
-b,--bcc TEXT ... Email address to add to bcc
-r,--replyto TEXT ... Email address for replies
-s,--subject TEXT ... Subject for email
--sign Sign email (overwriting default settings)
--nosign Do not sign email (overwriting default settings)
--encrypt Encrypt email (overwriting default settings)
--noencrypt Do not encrypt email (overwriting default settings)
--openpgp Use OpenPGP for signing/encrypting (overwriting default settings)
--smime Use S/MIME for signing/encrypting (overwriting default settings)
--header TEXT ... Arbitrary header formatted as "<name>: <value>"
--send-now Send email immediately
The following is an example of creating a message with a tag named special
:
echo "The body of the message." | emate mailto --to "Info <info@example.com>" --subject "The subject of the message." --header "#flags: special"
Here is an example of attaching a file to a new message:
echo "The body of the message." | emate mailto --to "Info <info@example.com>" ~/Desktop/file.txt
Shortcuts App
MailMate does not have built-in support for the macOS Shortcuts app (macOS 12+), but it’s possible to use the emate
command via the “Run Shell Script” action. Input can, e.g., be generated by another Shortcuts action and then passed to emate using the “to stdin” option. If installed as described above then emate
could be called like this:
~/bin/emate mailto --to "Info <info@example.com>" --subject "The subject of the message."