That’s all! Do you have in mind any other methods of sending emails with attachment from the Linux terminal, that are not mentioned in the list above? Let us know in the comments. To send a message with attachment, run the command below. Mpack encodes the named file in one or more MIME messages and sends the message to one or more recipients, or writes it to a named file or set of files, or posts it to a set of newsgroups. $ echo "Message Body Here" | mailx -s "Subject Here" -a backup.zip 4. Now send the attachment mail from the command-line using mailx command. Mailx works more like the mutt command and it it also a part of mailutils (On Debian) package. Read more about Mutt – A Command Line Email Client to Send Mails from Terminal 3. $ echo "Message Body Here" | mutt -s "Subject Here" -a backup.zip You can send an email with attachment using the mutt command below. If you do not have it on your system, type the command below to install it: $ sudo apt-get install mutt Mutt is a popular, lightweight command line email client for Linux. In this article, we will explain how to use at and its companion utilities batch, atq, atrm to view, delete, and create jobs to be executed at a later time. Jobs created with at are executed only once. You can as well send an existing message from a file as follows: $ mail -s "Subject here" -t -A backup.zip < message.txt at is a command-line utility that allows you to schedule commands to be executed at a particular time. $ echo "Message Body Here" | mail -s "Subject Here" -A backup.zip Now its time to send an email attachment using mail command a shown. Mail is part of the mailutils (On Debian) and mailx (On RedHat) package and it is used to process messages on the command line. Below are the various, well known methods of sending email with attachment from the terminal.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
February 2023
Categories |