0
我在$ email_template中設置了電子郵件正文。然後希望使用該功能發送帶附件的電子郵件,例如, do_mail attachment.csv [email protected]
。附件和正文發送電子郵件的函數
$email_template="Subject: Listing - `date --date="tomorrow" +"%A %d %B %Y"`
From: [email protected]
To: $2
Content-Type: plain/text
Please see attached listing - `date --date="tomorrow" +"%A %d %B %Y"`
"
do_mail() {
uuencode $1 $1 |
printf "$email_template" "$2" |
/usr/sbin/sendmail -oi -t
}
由於沒有發送電子郵件,是否有一些錯誤?
如果你不清楚,打印你的'$ email_template'和/或用'cat'替換'sendmail'調用。 – glglgl