$ echo "hello" | mail -s test -A attachmentfilename.txt $ mail -s test < /path/to/mail/content/file To pick mail body from a file, use the following command: You can also attach CC: and other headers using it. $ echo "hello" | mail -s test that -a is used to attach headers and can be repeated multiple times. To send email with a specific subject and piping mail body content: Sending mail with specific “from email” and subject Ii mailutils 1:2.99.98-1.1 amd64 GNU mailutils utilities for handling mail ||/ Name Version Architecture Description |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend In case you dont have mailutils installed, install it using apt-get.ĭesired=Unknown/Install/Remove/Purge/Hold Here are some ways you can send mail using Linux mail utility (mailutils package) on Ubuntu Linux. As an example you can send daily php error logs (with some cap) to your email. Linux command line tools to send mails are very handy for sending mails from bash scripts. find - exclude directory or file pattern.Linux - find files containing specific text.Linux - find and delete files older than 30 days.csvkit - parse csv file and data on Linux command line.bower - installation and quick start guide.Use watch to monitor a command at some frequency on Linux.Perl command line - replace multi line comments.Memcache - how to dump all keys and values on command line.Linux/Unix - truncate a large log file without deleting it.Linux/Unix - find inode number of a file.Linux/Unix - How to go to previous directory.Linux how to modify a user using usermod.Linux - sending mail from command using mailutils.Linux - providing sudo access to a users - some best practices.Linux - how to run a command as different user.How to zip/unzip a directory with password.How to specify environment variable for a command on Linux.How to sort using a specific field on Linux.How to show environment variable for a process id (pid).How to kill unresponsive ssh session using escape sequence.How to delete files starting with dash/hyphen.Find which process is listening on a port on Linux.Edit a file without changing its timestamp on Linux.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |