Mail is not working in cronjob

If i am using this command i am getting this error
mail -s 'Test Mail From' -a ""

**********Getting this error*************
mail: invalid option -- a
Usage: mail [-iInv] [-s subject] [-c cc-addr] [-b bcc-addr] to-addr ...
            [-- sendmail-options ...]
       mail [-iInNv] -f [name]
       mail [-iInNv] [-u user]
Who is Participating?
omarfaridConnect With a Mentor Commented:
try this

uuencode <  | mail -s 'Test Mail From'
woolmilkporcConnect With a Mentor Commented:
Your mail client doesn't support the "-a" option.

Try "mutt" instead.

"man mutt" for more.
gunasekharyalamuriAuthor Commented:
[root@web02 ~]# man mutt
No manual entry for mutt
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

gunasekharyalamuriAuthor Commented:
insatall mutt package can i have any sample command to send mail using mutt
woolmilkporcConnect With a Mentor Commented:
Which is your OS?

Get the mutt package for your OS and install it.

Alternatively you can use uuencode:

/usr/bin/uuencode /path/to/ | /usr/bin/mail -s "Test"

Always use full paths in crontab!
/usr/bin/mutt -a /path/to/ -s "Test"
The solution you accepted is essentially the same as I wrote in #38317654 earlier.

Anyway, thx for the points!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.