olzjunky.blogg.se

The mail command in linux
The mail command in linux









the mail command in linux

For example, we need to send a file named ‘test.txt’, so we will use the following command, Now to send a mail with a file as an attachment, we will use option ‘A’ with the mail command. $ mail -s “test mail” 3- Sending a mail with an attachment $ mail -s “test mail” <<< “This is the body of the mail” 2- Send mail to multiple recipientsįor sending mail to more than one user, mention all email addresses followed by a comma. We can also use the following single line command to send mail, Now after you execute the above command, we need to enter the body content & once we are done, press CTRL + D to exit and send the mail. Mail is the quickest way of communicating messages to your beloved kinds, there are unique e mail consumer servers that allow buyers to send emails, besides this, Linux by default delivers the aspect of sending an email applying the “mail” command by its terminal.Here, -s option is used for mentioning the subject of mail followed by the email address on which we need to send the mail. We also discussed the usage of the mail command in detail in Debian and Ubuntu-based Linux distributions.

the mail command in linux

In this write-up, we have discussed the mail command and its installation commands in different distributions of Linux. The mail command is not used to send emails only but also to view and receive emails from the recipients. In Linux, the mail command is a command-line utility that is used to send and manage the emails from the command line. We can observe that the specified emails have been deleted from the inbox, in this way, we can manage the mail inbox as well. To confirm the deletion of the mails, run the command of mail again: Similarly, to delete the emails from 4 – 15, just type “d 4 15” and press the ENTER key: The mail and its detail have been opened: In the output, we can see there are thirteen mails, to open any mail, we can write its index number and press the ENTER key, for example, if we want to open the seventh mail, we will type “7” and press the ENTER key: To read the mails, use the command of “mail”: $ mail -s “casual mail” maadiim.mm < /home /hammad /mymail.txt











The mail command in linux