简体   繁体   中英

sending s3 file as an attachment in mailx

I am trying to send a S3 file as an attachment using mailx , I have below command which works fine for sending a normal file on unix file system, but how to use it with a s3 file system.

mailx -r ${from} -a ${file_path_attach} -s "${subject}" "${recipients}" << EOM

${message}
EOM

I am able to do it as below.

also make sure the email functions are installed on the cluster you are trying to run mailx command

#move the S3 file to local DIR on AWS
s3cmd get S3:attach.txt /tmp/attach.txt

#send the email with attachment
mailx -r test@test.com -a /tmp/attach.txt -s "TEST Subject" "test@test.com" << EOM

TEST body
EOM

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM