我必须编写一个脚本来使用unix
shell脚本发送邮件.
以下脚本允许我拥有可变的消息体.
#!/bin/bash # Sending mail to remote user sender="root@sped56.lss.emc.com" receiver="root@sped56.lss.emc.com" body="THIS IS THE BODY" subj="THIS IS THE SUBJECT." echo $body | mail $receiver -s "THIS IS THE SUBJECT" // this works fine echo $body | mail $receiver -s $subj // ERROR - sends one mail with only //"THIS" as subject and generates another error mail for the other three words