We could do this using uuencode
:
uuencode actual_file display_file_name | mailx testemail@org.com
Could you please advice how this can be done using mailx -a
?
The only option seems to be to copy file with a different name, and then try.
We could do this using uuencode
:
uuencode actual_file display_file_name | mailx testemail@org.com
Could you please advice how this can be done using mailx -a
?
The only option seems to be to copy file with a different name, and then try.
When you are using -a
option, the mailx
program will do all the necessary conversions to base64 and then to MIME format for you. No need to use uuencode
echo | mailx -a actual_file testemail@org.com
The only trick is that for some reason mailx
does not work if you put -a actual_file
after the recipient email address.
Note that using echo
command makes sure that mailx
will not ask you to enter subject and message body manually.
p.s. replying to your comment... AFAIK, there is no such option in mailx
program to provide different display name. In order to attach a file such that it is shown under a different name in e-mail, you can do
ln -s actual_file attached_file
echo | mailx -a attached_file testemail@org.com
rm -f attached_file