标签:乱码 email server subject -o 邮件报警 from 转换 标题
#!/bin/bashmessage_subject_gb2312=iconv -t GB2312 -f UTF-8 << EOF<br/>$message_subject_utf8<br/>EOF
[ $? -eq 0 ] && message_subject="$message_subject_gb2312" || message_subject="$message_subject_utf8"
message_body_gb2312=iconv -t GB2312 -f UTF-8 << EOF<br/>$message_body_utf8<br/>EOF
[ $? -eq 0 ] && message_body="$message_body_gb2312" || message_body="$message_body_utf8"
sendEmail=‘/usr/local/bin/sendEmail‘
$sendEmail -s "$SMTP_server" -xu "$username" -xp "$password" -f "$from_email_address" -t "$to_email_address" -u "$message_subject" -m "$message_body" -o message-content-type=text -o message-charset=gb2312
标签:乱码 email server subject -o 邮件报警 from 转换 标题
原文地址:http://blog.51cto.com/diyunjie/2062550