How do I send a file as an email attachment using Linux command line?

后端 未结 26 2978
盖世英雄少女心
盖世英雄少女心 2020-11-22 04:39

I\'ve created a script that runs every night on my Linux server that uses mysqldump to back up each of my MySQL databases to .sql files and packages them togeth

26条回答
  •  轮回少年
    2020-11-22 05:05

    None of the mutt ones worked for me. It was thinking the email address was part of the attachemnt. Had to do:

    echo "This is the message body" | mutt -a "/path/to/file.to.attach" -s "subject of message" -- recipient@domain.com
    

提交回复
热议问题