3

I'm currently scheduling cron jobs on my Raspberry (Buster) to run python3 code every day, and send the result via email through msmtp.

07 12 * * * python3 /home/pi/Documents/code.py 2>&1 | msmtp -a default my.email@gmail.com

this works without issues. However, the email is sent to my.email@gmail.com as bcc (and empty TO field) as well as without subject.

I've tried overriding the subject as follows

07 12 * * * python3 /home/pi/Documents/code.py 2>&1 | msmtp -s "test" -a default my.email@gmail.com

but I can't make it work. What am I doing wrong, how can I set TO and subject fields properly?

Thanks in advance

Kim Chi
  • 51
  • 4

0 Answers0