0

CentOS 7. I have a python script to generate a report in csv format. I have made to script to run periodically using bash script in crontab. It works fine.

Now the report being generated and saved in local folder. I need to send email with this csv file everytime it generates. Could someone help me how to write bash script to achieve this?

I have to send it to corporate email (not public email like Gmail, Yahoo..). Any help is appreciated. Thanks.

I have tried mailx, mutt. Nothing works. I need some help here.

Rangs
  • 1
  • 1
    depending on what version of mailx you're using - just specifying : -a will attach it to the email. i.e. mailx -s "test subject" -a /tmp/dummy.csv -c "copyreceipient@email.address.com" recipient@email.address.com – FreudianSlip Feb 10 '23 at 08:52
  • Determine what `mailx` you have. There are many variants of the original Berkeley `mailx`. Heirloom mailx supports `-a` for attachments as does the most actively developed variant `s-nail`. Others do not support `-a`, so it depends on what you are running. – David C. Rankin Feb 10 '23 at 09:28

0 Answers0