Sending a mail from a linux shell script

后端 未结 11 2065
一个人的身影
一个人的身影 2020-12-04 06:52

I want to send an email from a Linux Shell script. What is the standard command to do this and do I need to set up any special server names?

11条回答
  •  隐瞒了意图╮
    2020-12-04 07:32

    On linux, mail utility can be used to send attachment with option "-a". Go through man pages to read about the option. For eg following code will send an attachment :

    mail -s "THIS IS SUBJECT" -a attachment.txt name@domain.com <<< "Hi Buddy, Please find failure reports."

提交回复
热议问题