How to email using a command line

Written by alan bradford
  • Share
  • Tweet
  • Share
  • Pin
  • Email
How to email using a command line
You can quickly populate a new e-mail message using a single command line. (E-mail LCD display image by Alex Yeung from Fotolia.com)

To send an e-mail, you typically have to perform several steps: open your e-mail program, open a blank e-mail, enter in the recipient's address, enter a subject line, and then write the actual message. Using a command line, you can do all of this by entering in a single line of text. The command line arguments will vary based on your e-mail program, such as Microsoft Outlook or Mozilla Thunderbird.

Skill level:
Easy

Other People Are Reading

Instructions

  1. 1

    Open a command line window by clicking the Windows "Start" menu on the left of the task bar. Click "Run."

  2. 2

    Enter the following text into the "Open" field: mailto:<to e-mail>&subject=<subject text>&body=<body text>.

    The "<to e-mail>" represents the recipient's e-mail address; the "<subject text>" represents the text in the subject line; and the "<body text>" represents the text in the body of the message. Enter the information for each of these text objects without the carats. (For example: "mailto:example@domain.com&subject=Hello there&body=Trying to e-mail from the command line.")

  3. 3

    Click "OK." The new e-mail opens in Outlook.

  4. 4

    Ensure the email, subject and body text are correct and click "Send."

  1. 1

    Open a command line window by clicking the Windows "Start" menu on the left of the task bar and then clicking "Run."

  2. 2

    Enter the following text into the "Open" field: thunderbird -compose "to:<to e-mail>,subject='<subject text>',body='<body text>'.

    The "<to e-mail>" represents the recipient's e-mail address; the "<subject text>" represents the text in the subject line; and the "<body text>" represents the text in the body of the message. Enter all of these text objects without the carats. (For example: "thunderbird -compose "to:example@domain.com,subject='Hello there',body='Trying to e-mail from the command line'.)

  3. 3

    Click "OK." The new e-mail opens in Thunderbird.

  4. 4

    Ensure the email, subject and body text are correct and click "Send."

Tips and warnings

  • You can also enter CC and BCC e-mail addresses in command line using the &cc;= and &bcc;= commands, respectively.

Don't Miss

Filter:
  • All types
  • Articles
  • Slideshows
  • Videos
Sort:
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the eHow.co.uk site, you consent to the use of cookies. For more information, please see our Cookie policy.