Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux mailx不发送html电子邮件_Linux_Bash_Mailx - Fatal编程技术网

Linux mailx不发送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

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 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