I want to use cron to execute a mutt script to send an email periodically. I've got the mutt installed and successfully sent emails by executing the mutt script like:
#!/bin/bash
mutt -s "Test from mutt" user@yahoo.com < /tmp/message.txt -a /tmp/file.jpg
Then I tried to execute this script in cron, but cron doesn't send the email as I expect. I'm sure that my cron is working because I used cron to execute another email tool:
#!/bin/bash
mail -s "Hello" "user@gmail.com"
This time cron did the work and sent the email at the expected time. So I'm thinking there maybe some problem when using cron to execute mutt command. Can anyone help me? My cron script is like following:
15 * * * * bash /Users/DengWenzhe/Study/SportsMedia101/sendEmail.sh
EDIT: The reason I want to use mutt is that I want to send email with attachment, which 'mail' version couldn't. If anyone know a command email tool that can work well with cron, that would also be helpful.