#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2005
    Posts
    14
    Rep Power
    0

    Send mail with attachment from command line


    Hello

    I have a question. I'm trying to send an email containing an attachment, directly from the command line.

    If I use sendmail, I have something like this:

    cat filename | uuencode filename | sendmail -fSender<senderemail@mail.com> cristi.tane@xnet.ro

    This sends filename as an attachment, but I can't seem to be able to enter a Subject and a message body.

    On the other hand, if I use mailx:

    cat filename | uuencode filename | mailx -s "Subject" cristi.tane@xnet.ro

    This sends filename as an attachment, but in this case I can't seem to be able to enter a message body in the command line.

    Any ideas?

    Thank you.
  2. #2
  3. No Profile Picture
    ......@.........
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jun 2004
    Posts
    1,345
    Rep Power
    56
    Here are several FAQ threads that deal with everything you need:
    http://www.unix.com/forumdisplay.php?f=22

IMN logo majestic logo threadwatch logo seochat tools logo