我尝试使用unix脚本在电子邮件中发送一些附件。我可以发送带附件的电子邮件,但附件中不包含任何数据。
#!/bin/csh
mailx -s "Sample attachment email" <<EOF
`uuencode myfile.txt`
EOF
答案 0 :(得分:0)
你应该用uuencode定义退出状态; 0(EXIT_SUCCESS), 1(EXIT_FAILURE)
#!/bin/csh
mailx -s "Sample attachment email" root@localhost <<EOF
`uuencode myfile.txt 0`
EOF