LoginSignup
5
8

More than 5 years have passed since last update.

HTMLメールをmailコマンドで送信

Last updated at Posted at 2016-05-10

参考

方法

  • HTMLヘッダーをechoで吐く
a.html
<style> li { white-space: nowrap; } </style>
<li>hoge
send_html.sh
send_html() {
    TO=$1
    SUBJECT=$2
    HTMLFILE=$3
    (echo "To: ${TO}"; echo "Subject: ${SUBJECT}"; echo 'Mime-Version: 1.0'; echo 'Content-Type: text/html'; echo ) \
    | cat - ${HTMLFILE} | sendmail -t
}

send_html "my@mailaddr.com" "kenmei" a.html
送信
sh send_html.sh
5
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
8