The Mutt E-Mail Client - official site
一、配置文件
/etc/Muttrc
& /etc/Muttrc.d/
ubuntu@VM-100-22-ubuntu:~$ ls /etc/Muttrc
Muttrc Muttrc.d/
ubuntu@VM-100-22-ubuntu:~$ ls /etc/Muttrc.d/
charset.rc colors.rc compressed-folders.rc gpg.rc smime.rc
创建 /etc/Muttrc.d/smtp.rc
如下:
本范例,使用office 365邮箱
# Connection
set ssl_starttls=yes
set ssl_force_tls=yes
set ssl_use_sslv3=yes
set timeout=60
set smtp_authenticators="login"
set smtp_url="smtp://mail@xxx.com@smtp.partner.outlook.cn:587"
set content_type="text/html"
#
# # Outgoing
set realname="mail"
set from="mail@xxx.com"
set smtp_pass="password"
The configuration file ~/.muttrc will be used for each users. If it is not present, then the global config file /etc/Muttrc will be used.
~$ touch ~/.muttrc
~$ sudo chmod 600 ~/.muttrc
~$ nano ~/.muttrc
###
# User info
###
set realname = "alice"
set from = "alice.sub@email.com"
set use_from = no
set envelope_from ="yes"
mailboxes imap://mail.com
set folder="imap://mail.com/INBOX"
set imap_user="alice" #your IMAP user name or login
set imap_pass="mysecret" #your IMAP password
# If not set in ~/.bashrc:
set spoolfile = /var/mail/alice
二、发送邮件
echo "mail content" | mutt -s "Subject" xyz@gmail.com
mutt -s "Subject" -e "my_hdr From:abc@gmail.com Content-Type: text/html" xyz@gmail.com < body.html
mutt -s "Subject" \
-e "my_hdr From: abc@gmail.com" \
-e "my_hdr Content-Type: text/html" \
xyz@gmail.com < body.html
三、自定义 header
The Mutt E-Mail Client
linux - Multiple Headers for Mutt Command - Stack Overflow
Usage:
my_hdr string
unmy_hdr { * | field ... }
Sample:
echo "this is a test mail" |mutt -e "my_hdr X-Priority: 1" -s "test" username@xxx.com
X-Priority: 1
意思是设置邮件的重要性为高
set hdrs=yes my_hdr Return-Receipt-To: myself@example.com my_hdr X-Priority: 1 my_hdr Importance: high
网友评论