Test environment
QQMail
- Mac OS X 10.6, Mutt 1.4.2.3i
- Ubuntu 12.04 LTS, Mutt 1.5.21
sudo apt-get install mutt -y
Send mail
Mail service provider settingsQQMail
Settings -> Accounts -> POP3/IMAP/SMTP/Exchange Service -> Options
check 'POP3/SMTP Service'
Install SMTP client [msmtp] [http://msmtp.sourceforge.net]sudo apt-get install msmtp msmtp-mta -y
sudo apt-get install msmtp ca-certificates
create or update ~/.muttrc
set editor="emacs -nw "
set sendmail="/usr/sbin/sendmail"
set sendmail_wait=10
create or update ~/.msmtprc
defaults
tls on
tls_starttls on
tls_certcheck on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
logfile /tmp/msmtp.log
account default
host smtp.gmail.com
port 587
from my_account@gmail.com
auth on
user my_account
password secret
change configuration file's permissionchmod 600 ~/.msmtprc
send mailecho 'content' | mutt -s 'subject' -- to_some_one@test.com
send mail with attachmentecho 'content' | mutt -s 'subject' -a /tmp/attach.zip -- to_some_one@test.com