How can I add attachment to mailx mail?
mail -s "my subject" -a /home/foo/dummy.log [email protected]
when using the above I get email and the body test is /home/git/dummy.log
instead of the actual file
How can I add attachment to mailx mail?
mail -s "my subject" -a /home/foo/dummy.log [email protected]
when using the above I get email and the body test is /home/git/dummy.log
instead of the actual file
According to this use you should use:
echo "MESSAGE BODY" | mailx -s "SUBJECT" -a "FILEPATH" -a "ANOTHERFILE" [email protected]
Take care if you are under HP-UX system you should use this :
( cat message_content_file; ux2dos attachment_file.txt | uuencode attachment_file.txt attachment_file.txt ) | mailx -m -s "subject" -r mail@sender mail@recipient
The attachment file can differ from .txt
Hope it can help !