Linux Learning to send email to a designated user

Source: Internet
Author: User

Send mail

The operation after entering the mail program is simple, but can not enter the Mail & Operation Prompt interface, here are a few practical examples:

1. Send to [email protected]

1 [[email protected] ~]# Mail [email protected]23 Subject:hi, a mail to Snailwarrio R! 4 5 This was Hoho_zhao in Beijing. 6 7 . 8 9 // enter the carriage directly and don't cc it to WHO.

  "Note" use. or ctrl+d to end the content input

"Note" By default two times CTRL + C key interrupts work

2, if snail is the user of the system, so send him a letter

1 [[email protected] ~]# mail-s "Hi, snail, i ' m root" snail23  plz reply me, snai L. 4 5 . 6 7 Cc:

Or

1 [[email protected] ~]# mail-s "Hi, snail, i ' m root" snail < email content

-S theme

-C CC

-B Dark Send

Receive mail

Similarly, using mail, assuming that the host is logged in as root, and then entering mail, the following information is output:

1 [[email protected] ~]$ mail2 Mail version 8.1 6/6/93.   for Help . 3 New 4 >n  1 [email protected]   Wed Mar  4 13:36  18/663   "Nice to Meet You"5 & amp;  <== here can enter a lot of commands, if you want to check, input? Can!

The prompt character in mail is the & symbol, the letter in front of the > represents the current processing of the letter, while the greater than the left of the symbol N for the letter has not been read, if I want to know what the command inside the mail, you can enter after & "? ", you can see the following screen:

1&?2 Mail Commands3T <message list>type Messages4NGotoand type next message5E <message list>Edit Messages6F <message list>give head lines of messages7D <message list>Delete Messages8S <message list>file Append messages to file9U <message list>Undelete MessagesTenR <message list>reply to Message senders OneR <message list>reply to Message senders and all recipients APre <message list> make messages go back to/usr/spool/Mail -M <user list>mail to specific users - Q quit, saving unresolved messages in mbox theX quit, DoNot remove System mailbox - h Print out active message headers -!Shell Escape -cd [directory] chdir to directory or homeifNone given

<message list> refers to the number on the left of each email! Several of the more common commands are:

Command Significance
H List the letter headers, or enter "H 40" If you want to check the letter headers around the 40 letters
D Delete the subsequent incoming letter number, delete the single letter is "D10", delete the 20~40 is "d20-40". However, this action to take effect, you have to cooperate with the Q this command (see below)!
S Save the letter as a file. For example, I want to save the contents of the 5th letter as ~/mail.file: "s 5 ~/mail.file"
X Or you can enter exit. This is the meaning of "leave the mail program without any action". No matter what letters you've just deleted, or what you've read, using exit will leave mail directly, so the deletions and readings you just made will not work. If you just look at the mail, in general, it is recommended to use this to leave! Unless you really want to delete some of the letters.
Q Relative to exit does not move away, Q will take two actions: 1. Move the letter just removed out of mailbox; 2. Deposit the letters that have just been read in ~/mbox and move out of the mailbox. Brother Bird usually do not like to use Q to leave, because, it is easy to forget to read what a knock ~ led to the letter to his emigration mailbox said ~

Since the read letter is used "Q" To leave mail, the letter will be moved to ~/mbox, so you can imagine:/var/spool/mail/vbird1 for vbird1 "new box", and/home/vbird1/mbox is "Inbox" Meaning, then how to read/home/vbird1/mbox? Just use "Mail-f/home/vbird1/mbox".

Linux Learning to send email to a designated user

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.