【发布时间】:2019-03-19 11:10:08
【问题描述】:
我正在尝试在我的 shell 脚本中使用 mailx 向用户发送邮件,但不透露电子邮件地址。
这是我的一段代码 -
query1=$(sqlplus -s ${ORA_UID_PSWD} << 'EOF'
set heading OFF
SELECT cu.cntct_email
FROM cm_user cu, cm_usertype ct
WHERE trunc(cu.xprtn_dt) = trunc(sysdate) - 60
AND cu.cm_user_id=ct.cm_user_id
AND ct.user_type = 'E'
AND cu.cntct_email is not null;
EOF
)
user_list1=$(echo "$query1" | tr '\n' ',' | sed 's:^.\(.*\).$:\1:')
echo $user_list1
echo -e "Hi,\nFYI.. Your password is expired 60 days ago. Please login and get it reset.\n\nThanks" |mailx -s "Password expired" -b $user_list1
我尝试使用 -b 选项(BCC),但我收到错误 -
不指定主要收件人的发送选项。
用法:
mailx -eiIUdEFntBDNHRV~ -T FILE -u USER -h hops -r address -s SUBJECT -a FILE -q FILE
-f FILE -A ACCOUNT -b USERS -c USERS -S OPTION users
任何人都知道我如何在不使用 To(Primary reciepnt) 的情况下发送
【问题讨论】: