xdg-email — command line tool for sending mail using the user's preferred e-mail composer
xdg-email opens the user's preferred e-mail composer in order to send
a mail to
mailto-uri. RFC2368 defines mailto:
URIs. xdg-email limits support to, cc, subject and body fields in
mailto-uri, all other fields are silently
address(es) must follow the
syntax of RFC822. Multiple addresses may be provided as
All information provided on the command line is used to prefill corresponding fields in the user's e-mail composer. The user will have the opportunity to change any of this information before actually sending the e-mail.
xdg-email is for use inside a desktop session only. It is not recommended to use xdg-email as root.
textmay contain linebreaks.
Specify an attachment for the e-mail.
must point to an existing file.
Some e-mail applications require the file to remain present after xdg-email returns.
xdg-email honours the following environment variables:
An exit code of 0 indicates success while a non-zero exit code indicates failure. The following failure codes can be returned:
xdg-email 'Jeremy White <email@example.com>'
xdg-email --attach /tmp/logo.png \ --subject 'Logo contest' \ --body 'Attached you find the logo for the contest.' \ 'firstname.lastname@example.org'
xdg-email --subject 'Your password is about to expire' \ 'email@example.com' 'firstname.lastname@example.org' 'email@example.com'