How to send a html email with the bash command “sendmail”?

后端 未结 8 2262
旧巷少年郎
旧巷少年郎 2020-12-13 09:50

Anyone has a demo available?

Sendmail is said to be not scalable,but it\'s free,so I decided to use it first for now:)

8条回答
  •  粉色の甜心
    2020-12-13 10:15

    The following works:

    (
    echo "From: ${from}";
    echo "To: ${to}";
    echo "Subject: ${subject}";
    echo "Content-Type: text/html";
    echo "MIME-Version: 1.0";
    echo "";
    echo "${message}";
    ) | sendmail -t
    

    For troubleshooting msmtp, which is compatible with sendmail, see:

    • https://wiki.archlinux.org/index.php/Msmtp
    • https://superuser.com/a/868900/9067

提交回复
热议问题