Linux uses Mutt to send mail/attachments

Source: Internet
Author: User
Tags mysql backup

Email is extremely handy with mutt, with just one command to send or bulk mail
Function Description: E-mail Management program.

Syntax: Mutt [-hnprvxz][-a< file >][-b< address >][-c< address >][-f< mail file >][-F< profile >][-H< Mail Draft >][-i < file >][-m< type >][-s< subject >][email address]

Added: Mutt is a text-mode mail management program that provides a full screen operation interface.

Parameters
-a< File > Add additional files to the message.
-b< address > Specify the recipient address of the blind copy.
-c< address > Designated copy of the delivery address.
-f< mail File > Specify the message file to load.
-f< configuration File > Specify the settings file for Mutt program without reading the preset. muttrc file.
-h displays Help.
-h< Mail Draft > Send a draft of the specified message.
-i< File > Inserts the specified file into the message text.
-m< type > Specify the default mail mailbox type.
-N Do not read the program planting file (/ETC/MUTTRC).
-p After you finish editing the message in Mutt and don't want to send the message immediately, you can send the message in a reprieve.
-R opens the mail file in a read-only manner.
-s< topic > Specify the subject of the message.
-V Displays the version information for Mutt and the parameters given when the file was compiled.
-X simulates the way Mailx is edited.
-Z with the-f parameter, if there is no mail in the message file will not start mutt.

1. Installation method

Debian Installation #
apt-get install -y mutt

CentOS Installation #
yum install -y mutt

2. How to use

The simplest method of testing
echo "Test" | mutt -s "Title" [email protected]
With accessories.
echo "Test" | mutt -s "mysql backup" -a /mysql.tar.gz [email protected]
Read the information in the text as content
mutt -s "Test" [email protected]

Add multiple Attachments
echo "Test" | mutt -s "web backup" -a /mysql.tar.gz -a /web.tar.gz [email protected]

-S "mysql backup" message parameters and title

-a/mysql.tar.gz parameters and paths for sending attachments

Read Mail.txt content for the message content, content must be UTF8 encoded, otherwise garbled

3. Set the sender
Editing a configuration file
vi /etc/Muttrc

Add the following to prevent it from being used as junk e-mail

set from="[email protected]"
set use_from=yes
set envelope_from="yes"
set realname="mutt"

[Email protected] is the sending address

Mutt for Sender

Sending a message is slightly slower and requires waiting a minute or longer to send a successful (scheduled backup)

Reprint Please specify: Notes»linux use mutt Send mail/attachment

Come from:http://www.isucc.me/129.html

Linux uses Mutt to send mail/attachments

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.