In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you how to use the Linux command line to send e-mail, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
Linux provides several commands that allow you to send email through the terminal. Here are some interesting ways to do this.
Linux can send email from the command line in a number of ways. Some of the methods are very simple, some are relatively complex, but still provide a lot of useful features. Which approach you choose depends on what you want-send a quick message to a colleague or send a more complex message with attachments to a group of people. Next, take a look at several possible options:
The most convenient Linux command to send a simple message is mail. Suppose you need to remind your boss that you have to leave early today, you can use a command like this:
$echo "Reminder: Leaving at 4 PM today" | mail-s "early departure" myboss
Another way is to extract the text message you want to send from a file:
$mail-s "Reminder:Leaving early" myboss < reason4leaving
In both cases, you can use-s to add a title to the email.
Sendmail
Use the sendmail command to send an express message without a title. (replace recip with destination recipient):
$echo "leaving now" | sendmail recip
You can use this command to send a message with a title but no content:
$echo "Subject: leaving now" | sendmail recip
You can also use sendmail to send a complete message containing a header line. However, when you use this method, your title line will be added to the file to be sent, as shown in the following example:
Subject: Requested lyricsI would just like to say that, in my opinion, longer hair and other flamboyantaffectations of appearance are nothing more...
You can also send such a file (the lyric file contains the title and body):
$sendmail recip < lyrics
The output of sendmain can also be lengthy. If you are curious and want to see the interaction between the sending system and the receiving system, add the-v (verbose) option.
$sendmail-v recip@emailsite.com < lyricsmutt
Mutt is a good tool for sending emails from the command line, and you need to install it before using it. One of the convenient advantages of mutt is that it allows you to add attachments to your email.
Use mutt to send a quick message:
$echo "Please check last night's backups" | mutt-s "backup check" recip
Get the content from the file:
$mutt-s "Agenda" recip < agenda
Use the-an option to add attachments to mutt. You can even add more than one attachment-as shown in the following command:
$mutt-s "Agenda" recip-an agenda-a speakers < msg
In the above command, the msg file contains the body of the message. If you have nothing else to add, you can replace the previous command like this:
$echo "" | mutt-s "Agenda" recip-an agenda-a speakers
Another useful feature of mutt is the ability to add CC (- c) and BCC (- b).
$mutt-s "Minutes from last meeting" recip@somesite.com-c myboss < minstelnet
If you want to delve deeper into the details of sending email, you can use telnet for email interaction. But as said, you need to "learn terminology". The mail server expects a series of commands, including self-introduction (EHLO command), provide the sender (MAIL FROM command), specify the recipient (RCPT TO command), then add the message (DATA) and use. End message. Not all email servers respond to these requests. This method is usually used only for troubleshooting.
$telnet emailsite.org 25Trying 192.168.0.12...Connected to emailsite.Escape character is'^] '.220 localhost ESMTP Sendmail 8.15.2; Wed, 12 Jun 2019 16:32:13-0400; (No UCE/UBE) logging access from: mysite (OK)-mysite [192.168.0.12] EHLO mysite.org
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.