Linux システムからメールを送信するためにmailコマンドを使用しています。
私が得ている問題は、メールのコンテンツタイプが常にContent-Type: text/plain; charset=us-ascii
.
HTMLコンテンツを送信していますが、プレーンテキストとして表示されています。
これは私が試したものです
1)
body="From: me@example.org
To: me@gmail.com
Subject: MIME Test
Mime-Version: 1.0
Content-Type: text/html
<html>
<body>
This is a test.
</body>
</html>";
echo $body| mail -s "testing purpose" reciever@gmail.com
これはうまくいきませんでした
このhtmlを$tempfileのtest.htmlというファイルに入れ、このように実行しようとしました
2)
mail -a 'MIME-Version: 1.0' -a 'Content-Type: text/html; charset=iso-8859-1' "server details" "receiver@gmail.com" < $tempfile
これについて私に提案してください (sendmail/mutt ではなくメールのみを使用してください)。