mail a file using mail utility

Posted on 2006-04-07
Last Modified: 2010-04-20
how to mail a file from /usr/local/asd.txt to the I did something likes this
mail < /usr/local/asd.txt
is it right?
Question by:ajaypappan
    LVL 12

    Accepted Solution

    if you wanna send as attachement try this

    cat file | uuencode tgt_filname | mail -s "subject"
          ^                 ^
          |                 +--- attachment FILENAME for the target host to use
          +--- attachment CONTENT from the source host
    LVL 12

    Expert Comment

    "mail < /usr/local/asd.txt
    is it right?"

    this will make the content of asd.txt as the mail body and send an email to

    if you wanna to send like this with a suject, as the -s option.
    LVL 12

    Expert Comment

    sorry typo

    add the -s option

    Featured Post

    Live: Real-Time Solutions, Start Here

    Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

    Join & Write a Comment

    In this tutorial I will explain how to make squid prevent malwares in five easy steps: Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more. It reduces bandwidth and improves response times by caching and reusing frequently-…
    Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
    Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
    Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now