How to Send an Email (Mail Message) from Linux Command Line Shell Làm thế nào để Gửi một email (thư tin nhắn) từ Linux Command Line Shell

Occasionally system administrator may need to send a test email, or emergency mail message right from the shell or command line interpreter when using a Linux flavor or distribution of operating system, be Red Hat Fedora, Ubuntu, Debian, CentOS, Open SUSE, FreeBSD and others. Đôi khi hệ thống quản trị có thể cần phải gửi một email thử nghiệm, hoặc tin nhắn thư khẩn cấp ngay từ vỏ hoặc thông dịch dòng lệnh khi sử dụng một hương vị phân phối Linux hay hệ điều hành, được Red Hat Fedora, Ubuntu, Debian, CentOS, Open SUSE, FreeBSD và những người khác. In this case, the mail command will come in handy. Trong trường hợp này, lệnh thư sẽ có ích.

mail is a command to send and receive mail in Unix, Linux and BSD operating system. mail là một câu lệnh để gửi và nhận thư trong Unix, Linux và hệ điều hành BSD. To initiate a mail sending process, just type in the following command: Để bắt đầu một quá trình gửi mail, chỉ cần gõ vào lệnh sau:

mail recipient@domain.com

Obviously, replace recipient@domain.com with a valid email address. Rõ ràng, thay thế recipient@domain.com với một địa chỉ email hợp lệ.

The system will prompt for a subject of the email before allowing user to type in the mail message body. Hệ thống sẽ nhắc nhở cho một chủ đề của email trước khi cho phép người dùng nhập vào cơ thể thư.

# mail receipent@domain.com # Mail receipent@domain.com
Subject: For Testing Only Tiêu đề: Để kiểm tra Chỉ
This email is for testing the mail delivery system only. Email này là để thử nghiệm hệ thống chuyển phát thư chỉ.
^D (EOT) ^ D (EOT)
Cc: Đồng gửi:

Once finished typing the email message, press Ctrl-D (shown as ^D in example above), which represents End of Text (EOT). Sau khi gõ xong tin nhắn email, nhấn Ctrl-D (hiển thị như ^ D trong ví dụ trên), đại diện cho kết thúc của văn bản (EOT). Depending on system, mail may or may not prompt another input request for any recipients to cc (carbon copy) to. Tùy thuộc vào hệ thống, thư có thể hoặc có thể không nhắc một yêu cầu đầu vào cho những người nhận để sao chép cc-bon () để. Press Enter to skip or accept the input, and get the mail sent. Nhấn Enter để bỏ qua hay chấp nhận đầu vào, và nhận được thư gửi.

Tip: If the sender and recipient is on the same system, it's possible to omit the domain (@domain.com) part of the address, leaving only user name. Mẹo: Nếu người gửi và người nhận là trên cùng một hệ thống, nó có thể bỏ qua các tên miền (@ domain.com) là một phần của địa chỉ, để lại tên người dùng chỉ.

It's also possible to use mail's arguments or switches to directly send mail without interactive input. Cũng có thể sử dụng đối số hoặc chuyển mạch của thư trực tiếp gửi thư mà không có đầu vào tương tác. For example, Ví dụ,

mail -s Test address@domain.com < /dev/null

Command above will immediately send a blank email with empty body to the recipient address with the subject "Test". Lệnh trên ngay lập tức sẽ gửi một email với cơ thể trống rỗng đến địa chỉ người nhận với các thử nghiệm "đối tượng". For more arguments, type "man mail". Đối với các đối số khác, gõ "man thư".

IMPORTANT : The page is machine translated and provided "as is" without warranty. Quan trọng: Sửa là máy dịch và cung cấp "như là" không có bảo hành. Machine translation may be difficult to understand. Máy dịch thuật có thể khó hiểu. Please refer to Vui lòng tham khảo original English article bản gốc tiếng Anh bài viết whenever possible. bất cứ khi nào có thể.


3 Responses to “How to Send an Email (Mail Message) from Linux Command Line Shell” 3 Responses to "Làm thế nào để Gửi một email (thư tin nhắn) từ Linux Command Line Shell"

  1. maria a. maria a.
    July 29th, 2009 06:48 29 Tháng 7 Năm 2009 06:48
    3 3

    how do i config my sendmail to make it work? làm thế nào để tôi config sendmail của tôi để làm cho nó hoạt động? i have ubuntu and it wont work without it. i có ubuntu và nó làm việc wont mà không có nó.
    thanks! cảm ơn!

  2. tim tim
    June 29th, 2009 00:24 Ngày 29 tháng 6 2009 00:24
    2 2

    you have to config your sendmail to make it work bạn phải config sendmail của bạn để làm cho nó hoạt động

  3. 908 908
    June 28th, 2009 11:53 Ngày 28 Tháng Sáu 2009 11:53
    1 1

    Argh. Argh. It's a Terminal not a commandline. Đó là một ga không phải là một commandline.

Leave a Reply Để lại một trả lời

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> Bạn có thể sử dụng các thẻ: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime = ""> <em> <i> <q <strike> <strong>

Subscribe to comments feature has been disabled. Thuê bao với ý kiến đều đã bị vô hiệu hoá. To receive notification of latest comments posted, subscribe to Để nhận được thông báo mới nhất đăng ý kiến, đăng ký với My Digital Life Comments RSS feed My Digital Life kiến RSS feed or hoặc register to receive đăng ký để nhận được new comments in daily email digest. Các ý kiến mới trong email tiêu hàng ngày.
Custom Search

New Articles Bài viết mới

Incoming Search Terms for the Article Tìm đến các Điều khoản Điều

linux mail command linux mail lệnh - -- sendmail command line sendmail dòng lệnh - -- sendmail command line example sendmail dòng lệnh ví dụ - -- send mail from command line gửi thư từ dòng lệnh - -- linux mail command line linux thư dòng lệnh - -- sendmail command example sendmail lệnh ví dụ - -- linux mail from address linux thư từ địa chỉ - -- mail command in linux mail lệnh trong linux - -- linux command line mail Linux dòng lệnh mail - -- linux mail command example linux mail lệnh ví dụ - -- send mail command line linux linux gửi thư dòng lệnh - -- command line email linux dòng lệnh Linux email - -- linux send mail from command line linux gửi thư từ dòng lệnh - -- send mail from command line linux gửi thư từ Linux dòng lệnh - -- linux send email linux gửi email - -- mail command linux mail lệnh Linux - -- send email from command line gửi email từ dòng lệnh - -- sendmail command line subject sendmail lệnh dòng tiêu đề - -- sendmail example command line sendmail dụ dòng lệnh - -- linux sendmail example linux sendmail ví dụ - -- linux send email from command line linux gửi email từ dòng lệnh - -- linux email command line linux email dòng lệnh - -- linux mail command from linux mail lệnh từ - -- how to send mail in linux làm thế nào để gửi mail trong Linux - -- linux sendmail command linux sendmail lệnh - -- email command line email dòng lệnh - -- all tất cả - -- mail linux command mail linux lệnh - -- linux command line email Linux dòng lệnh email - -- sendmail command in linux sendmail lệnh trong linux - -- linux email command linux email lệnh - -- linux mail command from address linux mail lệnh từ địa chỉ - -- linux sendmail command line linux sendmail dòng lệnh - -- how to send mail from linux command line làm thế nào để gửi thư từ dòng lệnh Linux - -- linux sendmail command example linux sendmail lệnh ví dụ - -- man mail linux người đàn ông thư linux - -- sendmail command line email sendmail dòng lệnh email - -- send email command line linux linux gửi email dòng lệnh - -- shell mail command bao thư lệnh - -- sendmail send test email sendmail gửi email thử nghiệm - -- yahoo mail command line yahoo mail dòng lệnh - -- linux send email command line Linux dòng lệnh gửi thư điện tử - -- sendmail linux example sendmail linux ví dụ - -- sending mail from command line gửi thư từ dòng lệnh - -- linux commandline mail Linux commandline mail - -- send command line email gửi email dòng lệnh - -- linux send mail command line Linux dòng lệnh gửi thư - -- send email from linux command line gửi email từ dòng lệnh Linux - -- mail linux command line mail linux dòng lệnh - -- how to send email in linux làm thế nào để gửi email trong Linux - --