kascedis.blogg.se

Use mail command in linux
Use mail command in linux












Keep in mind that there may be more than two recipients. In this example we will send email both to the and. $ cat body.txt | mail -s "Hello World" Set Multiple RecipientĪnother useful feature of mail command is providing multiple recipients by simply delimiting recipients emails. There is other way to send mail by redirecting body content with pipe like below. How are you? I hope your pageviews are good.Īnd we send $ mail -s "Hello World" < body.txt There are multiple command line email clients available to achieve the attachment task, but the most common and widely used is mutt. In this example body.txt file contains body part of the mail. In order to send a file as an attachment to an email using Linux, we either need to make use of a command line email client or the standard linux mail command. Body part can be read from a file by simply redirecting the content to the mail command like below. But if it is long and repetitive task we do not want to do always there is an alternative. While sending email there will be body part of the mail.

Use mail command in linux install#

In order to work properly we should install the bsd-mailx package like below. Linux distributions provides two mailx command one from the mailutils package which is installed by default and the other one is from the bsd-mailx package. Mail Client Sender -> MTA of sender -> MTA receiver -> Mail Client Receiver Install mailx Command there are some protocol used to accomplish these tasks like smtp,pop3,imap etc.īelow are some architectural view of a simple email transmission. Mail Transfer Agent (MTA) is an intermedia component used to receive, send, store mail messages.Mail clients connects to the mail transfer agent to transmit emails. Mail Client is an application used by user directly to send and get emails.There are some terms we should learn before continue General ConceptĪs stated in previous paragraph email systems are bit more complex than standard client server architecture. mailx command supports the MIME, IMAP, POP3, SMTP, and S/MIME protocols and based Berkeley Mail 8.1 mail command. mailx more advanced version of the mail tool. We will look at a command-line based mailing application named mailx. An email has a different architecture than standard client-server. Linux has a lot of tools, services, and applications related to email.












Use mail command in linux