LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   I m new to Linux ,need help to send mail with attachment via mail command Rhel 5.3 (https://www.linuxquestions.org/questions/linux-newbie-8/i-m-new-to-linux-need-help-to-send-mail-with-attachment-via-mail-command-rhel-5-3-a-4175441467/)

panks1910 12-14-2012 12:13 PM

I m new to Linux ,need help to send mail with attachment via mail command Rhel 5.3
 
I m new to Linux ,need help to send a mail with attachment via mail command linux,Version is RHEL 4 & 5.3.

shivaa 12-14-2012 12:56 PM

Are there any mail services running on your system? It should be running in order to send an email. Meanwhile, if it's running then you can send attachment as follow:
Code:

uuencode /path/to/file/ /path/to/file/ | mailx -s "<subject>" <recipient_mail_id>
For instance, if you want to send a file named /home/jack/sample.txt as an attachment to peter@somehost.com, use:
Code:

uuencode /home/jack/sample.txt /home/jack/sample.txt | mailx -s "Sample Test" peter@somehost.com


All times are GMT -5. The time now is 11:20 PM.