Mail is not working in cronjob

If i am using this command i am getting this error
mail -s 'Test Mail From' -a "test.zip" raghu@xpress.com

**********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]
gunasekharyalamuriAsked:
Who is Participating?
 
omarfaridConnect With a Mentor Commented:
try this

uuencode test.zip < test.zip  | mail -s 'Test Mail From' raghu@xpress.com
0
 
woolmilkporcConnect With a Mentor Commented:
Your mail client doesn't support the "-a" option.

Try "mutt" instead.

"man mutt" for more.
0
 
gunasekharyalamuriAuthor Commented:
[root@web02 ~]# man mutt
No manual entry for mutt
0
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
0
 
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/test.zip test.zip | /usr/bin/mail -s "Test" Raghu@xpress.com

Always use full paths in crontab!
0
 
woolmilkporcCommented:
/usr/bin/mutt -a /path/to/test.zip -s "Test" raghu@xpress.com
0
 
woolmilkporcCommented:
The solution you accepted is essentially the same as I wrote in #38317654 earlier.

Anyway, thx for the points!
0
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.