Linux mailx不发送html电子邮件
mailx不以HTML格式发送电子邮件。html代码作为电子邮件的附件而不是正文插入。我试图只发送一个html标记,而不是读取整个文档,但它不能被识别为html 我的代码是:Linux mailx不发送html电子邮件,linux,bash,mailx,Linux,Bash,Mailx,mailx不以HTML格式发送电子邮件。html代码作为电子邮件的附件而不是正文插入。我试图只发送一个html标记,而不是读取整个文档,但它不能被识别为html 我的代码是: MAIL_TPL="/layout/header.tpl.html" cat $MAIL_TPL > $MAIL SUBJECT "Test E-Mail" ( echo "Content-Disposition: inline" | cat - $MAIL > temp && mv tem
MAIL_TPL="/layout/header.tpl.html"
cat $MAIL_TPL > $MAIL
SUBJECT "Test E-Mail"
(
echo "Content-Disposition: inline" | cat - $MAIL > temp && mv temp $MAIL
echo "Content-Transfer-Encoding: 7BIT" | cat - $MAIL > temp && mv temp $MAIL
echo "Content-Type: text/html; charset=us-ascii" | cat - $MAIL > temp && mv temp $MAIL
echo "MIME-Version: 1.0" | cat - $MAIL > temp && mv temp $MAIL
echo "Subject: ${SUBJECT}" | cat - $MAIL > temp && mv temp $MAIL
echo "To: dest email" | cat - $MAIL > temp && mv temp $MAIL
echo "FROM: my name" | cat - $MAIL > temp && mv temp $MAIL
echo
echo "$(cat $MAIL)") | mailx -v -s "$SUBJECT" -S smtp-use-starttls -S smtp-auth=login -S smtp=smtp://smtp.myhost:587 -S from="my email" -S smtp-auth-user=myuser -S smtp-auth-password=mypassword -S ssl-verify=ignore -S nss-config-dir=/etc/pki/nssdb/ emaildest