Dear All,
This Post is relating to Useful Operating system techniques
to send mails using command : Mailx
1. To send mails with body and without attachments
syntax : cat <`file's full path and name`> mailx -s “<`Subject`>” <`Recipient`>
Example:
cat /home/myname/logs/mylog1.log mailx -s “Test Alert 1” xyz@gmail.com
2. To Send Mails without body and with attachments
syntax :
uuencode <`file's full path and name`> <`file's alias name`> mailx -s “<`Subject`>” <`Recipient`>
Example :
uuencode /home/myname/logs/mylog1.log alert1.log mailx -s “Test Alert 2” xyz@gmail.com
3. To Send Mails with body and attachments
syntax :
( cat <`file's full path and name`> ; uuencode <`file's full path and name`> <`file's alias name`> )
mailx -s “<`Subject`>” <`Recipient`>
Example :
( cat /home/myname/logs/mylog1.log ; uuencode /home/myname/logs/mylog1.log alert1.log )
mailx -s “Test Alert 3” xyz@gmail.com
Thanks & Regards,
Narasimha Rao.K
3 comments:
I believe, there is one problem sending attachments in UX... which is only text attachments are possible from command line. Is this TRUE?
Hi Sesha,
We can send any format files as attachments in any unix OS.
I have tested with other format files also.
Will know if you find any issues.
Thanks & Regards,
Narasimha Rao.K
Post a Comment