Tuesday, June 26, 2012

How to send attachment with unix 'mail' command

We can send attachment with the uuencode command as below:

uuencode file-to-be-attached  file-to-be-attached | mail -s "subject" send-to -- -r send-from

the 1st parameter to uuencode is the file to be attached while the 2nd parameter is the filename seen by the recipient.

In case uuencode command is not found on your system, you can get it as below:

yum install sharutils

No comments:

Post a Comment