-1

I try this for almost 4 hours now, in different ways. I googled a lot, but nothing I try work as expected.

I have a simple .msmtprpc file, that allows me to send mails like this:

echo -e "Subject: foobar\r\n\r\nContent" | msmtp my_mail@gmail.com

However, I can't seem to concatenate the full output of a Python script as content of the message.

This command:

( echo -e "Subject: aaa\r\n\r\n" ; python foo.py 2>&1; ) | msmtp foobar@gmail.com

works in my terminal, but not as a cron command. Perhaps we can improve it ?

Thanks for your time.

Yann
  • 55
  • 6

1 Answers1

1

As @Navern suggested, I put my whole command in to a bash script, then ran the bash script from cron. And, of course, an absolute path was necessary.

Yann
  • 55
  • 6