我最喜欢的是电子邮件(github)客户端。这非常简单,不需要复杂的配置,不需要依赖项。您可以通过命令行指定smtp-server参数,这意味着它更适合脚本编写。唯一可惜的是,大多数Linux发行版都不包含此工具,因此您需要自己编译。
来自github上的email projet的报价
问:什么是“电子邮件”?
答:'email'是我设计的程序,它将通过命令行将电子邮件发送到远程smtp服务器或在内部使用'sendmail',并与GNUPG进行完全交互以加密和签名电子邮件,因此您决定这样做。 ..您可以在以下网址获取GNUPG:http://www.gnupg.org
感谢cygwin让我知道这个有用的电子邮件客户端。
编译安装
./configure
make
./install.sh --version 3.1.3 --prefix /usr --mandir /usr/share/man --sysconfdir /etc
电子邮件的命令行选项
$ email --help
Options information is as follows
email [options] recipient1,recipient2,...
-h, -help module Print this message or specify one of the below options
-V, -verbose Display mailing progress.
-f, -from-addr Senders mail address
-n, -from-name Senders name
-b, -blank-mail Allows you to send a blank email
-e, -encrypt Encrypt the e-mail for first recipient before sending
-s, -subject subject Subject of message
-r, -smtp-server server Specify a temporary SMTP server for sending
-p, -smtp-port port Specify the SMTP port to connect to
-a, -attach file Attach file and base64 encode
-c, -conf-file file Path to non-default configuration file
-t, -check-config Simply parse the email.conf file for errors
-x, -timeout Set socket timeout.
-cc email,email,... Copy recipients
-bcc email,email,... Blind Copy recipients
-sign Sign the email with GPG
-html Send message in HTML format ( Make your own HTML! )
-tls Use TLS/SSL
-m, -smtp-auth type Set the SMTP AUTH type (plain or login)
-u, -smtp-user username Specify your username for SMTP AUTH
-i, -smtp-pass password Specify your password for SMTP AUTH
-g, -gpg-pass Specify your password for GPG
-H, -header string Add header (can be used multiple times)
-high-priority Send the email with high priority
-no-encoding Don't use UTF-8 encoding
样品用法
指定了SMTP服务器的简单邮件
echo "mail body" | email -subject "unix.stackexchange.com Q36982" -from-name LiuYan刘研 -from-addr liuyan@domain.com -smtp-server smtp.domain.com -smtp-port 25 cwd@your-domain.com your-friends@his-domain.com
HTML邮件
echo "<h1>header</h1><p>paragraph</p>" | email -html -subject "unix.stackexchange.com Q36982 HTML mail" cwd@your-domain.com
附件
echo "see the attachment(s)" | email -subject "This is my email.conf file" -attach /etc/email/email.conf -attach cwd@your-domain.com