Linux Commands Examples

A great documentation place for Linux commands


command line tool for sending mail using the user's preferred e-mail composer


xdg-email [--utf8] [--cc address] [--bcc address] [--subject text] [--body text] [--attach file] [mailto-uri | address(es)]

xdg-email {--help | --manual | --version}

add an example, a script, a trick and tips

: email address (won't be displayed)
: name

Step 2

Thanks for this example ! - It will be moderated and published shortly.

Feel free to post other examples
Oops ! There is a tiny cockup. A damn 404 cockup. Please contact the loosy team who maintains and develops this wonderful site by clicking in the mighty feedback button on the side of the page. Say what happened. Thanks!



xdg-email 'Jeremy White <jwhite[:at:]example[:dot:]com>'

xdg-email --attach /tmp/logo.png \
--subject 'Logo contest' \
--body 'Attached you find the logo for the contest.' \

xdg-email --subject 'Your password is about to expire' \
'jwhite[:at:]example[:dot:]com' 'bastian[:at:]example[:dot:]com' 'whipple[:at:]example[:dot:]com'


xdg-email opens the user's preferred e-mail composer in order to send a mail to address(es) or mailto-uri. RFC2368 defines mailto: URIs. xdg-email limits support to, cc, subject and body fields in mailto-uri, all other fields are silently ignored. address(es) must follow the syntax of RFC822. Multiple addresses may be provided as separate arguments.

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.

See for information on how the user can change the e-mail composer that is used.



Indicates that all command line options that follow are in utf8. Without this option, command line options are expected to be encoded according to locale. If the locale already specifies utf8 this option has no effect. This option does not affect mailto URIs that are passed on the command line.

--cc address

Specify a recipient to be copied on the e-mail.

--bcc address

Specify a recipient to be blindly copied on the e-mail.

--subject text

Specify a subject for the e-mail.

--body text

Specify a body for the e-mail. Since the user will be able to make changes before actually sending the e-mail, this can be used to provide the user with a template for the e-mail. text may contain linebreaks.

--attach file

Specify an attachment for the e-mail. file must point to an existing file.

Some e-mail applications require the file to remain present after xdg-email returns.


Show command synopsis.


Show this manualpage.


Show the xdg-utils version information.


Visit for information how to configure xdg-email to use the email client of your choice.


Copyright © 2006

environment variables

xdg-email honours the following environment variables:


Setting this environment variable to a non-zero numerical value makes xdg-email do more verbose reporting on stderr. Setting a higher value increases the verbosity.

exit codes

An exit code of 0 indicates success while a non-zero exit code indicates failure. The following failure codes can be returned:


Error in command line syntax.


One of the files passed on the command line did not exist.


A required tool could not be found.


The action failed.


No permission to read one of the files passed on the command line.


Kevin Krammer


Jeremy White


How can this site be more helpful to YOU ?

give  feedback