在Linux的命令行下发送HTML格式的邮件


搜索关键字:
  • linux formail sendmail in html format
  • Linux formail sendmail 发送HTML格式的邮件
  • Linux send email in html format
参考链接:
参考解答:
$ cat table.html
<table bgcolor=red><tr><td>这是一封测试邮件</td></tr></table>

$ mail -a 'Content-Type: text/html;charset=utf-8' -s "HTML format's email" [email protected] < table.html

$ mail -s "$(echo -e 'This is only a test of using `mail` command to send HTML format email\nContent-Type: text/html;charset=utf-8')" [email protected] < for.sh

$ cat table.html | formail -I "Content-Type: text/html; charset=utf-8" | sendmail [email protected]

=EOF=

, , ,

《 “在Linux的命令行下发送HTML格式的邮件” 》 有 4 条评论

  1. 默认情况下CentOS里面是没有安装formail这个命令的,所以需要先用yum安装对应的package,但是很多情况下我们并不清楚formail命令存在于哪个软件包中(直接 `yum search formail` 没有结果),所以需要使用下面的方式来定位命令 `formail` 是由哪个软件包提供的:
    `
    sudo yum provides */formail
    sudo yum install procmail
    `
    http://www.linuxnix.com/linux-yumrpm-check-which-package-provides-a-command-or-a-file/
    http://xmodulo.com/how-to-find-what-package-file-belongs-to-on-centos-fedora.html
    http://unix.stackexchange.com/questions/4705/how-to-find-out-which-package-a-file-belongs-to
    http://superuser.com/questions/467186/how-to-find-which-package-certain-command-belongs-to-on-centos

回复 a-z 取消回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注