Content-Type:text / htmlを使用してmailxを操作する方法

Content-Type:text / htmlを使用してmailxを操作する方法

mailxコマンドを使用してHTMLファイルを送信する必要がありますが、マークアップコードを含む電子メールを受信すると、次のように表示されます。

    <HTML><HEAD><TITLE>Title One /TITLE> <STYLE> body { width:900px; font-size: 10pt; font-family:verdana; 
.../...

私は次のコマンドを使用しました。

cat file.html | mailx -r [email protected] -s "Suject" -S content_type=text/html -S smtp=smtp.acme.com  [email protected]

私もこれを試しました

cat file.html | mailx -a 'Content-Type: text/html' -r [email protected] -s "Suject" -S content_type=text/html -S smtp=smtp.acme.com  [email protected]

上記の最後のエラーメッセージが表示されます。

Content-Type: text/html: No such file or directory

-aオプションに何がありましたか?

ベストアンサー1

私のmailxバージョンは次のとおりです。Heirloom mailx 12.5

このコマンドは私の問題を解決しました。

(echo "Content-Type: text/html"; cat file.html ) | mailx -r [email protected] -s "Suject" -S content_type=text/html -S smtp=smtp.acme.com  [email protected]

おすすめ記事