LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to attach attachment to mail and download it (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-attach-attachment-to-mail-and-download-it-842083/)

birla.sunil 11-03-2010 04:27 AM

how to attach attachment to mail and download it
 
how can attachment sends through mail command in linux with mail command either with mail -s or -v option also please confirm how to download the attachments from it . and how one should knows with mail command that attachment is present with the particular mail

mlangdn 11-03-2010 07:18 AM

Why don't you start with:

Code:

$ man mail
and do a little reading?

w1k0 11-03-2010 08:08 AM

Try my script. I called it mailing.

mailing:
Code:

#!/bin/bash

# "first@some.net,second@some.net" -- one e-mail to all (without spaces)
# "first@some.net, second@some.net" -- each e-mail separately (with spaces)
ADDRESSES="ADDRESSES.TXT"
MAIL="MAIL.TXT"

SUBJECT="This isn't a spam"

# "first -a second -a third" -- a few attachments
ATTACHMENT=""

SIGNATURE="~/.signature"
REPLY="me@own.org"

cat $MAIL > /tmp/mail
cat $SIGNATURE >> /tmp/mail

for address in `cat $ADDRESSES`
do
    if [ "$ATTACHMENT" != "" ]
    then
        nail -s "$SUBJECT" -a $ATTACHMENT -r $REPLY $address < /tmp/mail
    else
        nail -s "$SUBJECT" -r $REPLY $address < /tmp/mail
    fi
done

rm /tmp/mail


birla.sunil 11-04-2010 01:38 AM

Quote:

Originally Posted by mlangdn (Post 4147921)
Why don't you start with:

Code:

$ man mail
and do a little reading?

if i get the solution from reading this man
why can;t i approaches u

birla.sunil 11-04-2010 01:39 AM

Quote:

Originally Posted by w1k0 (Post 4147968)
Try my script. I called it mailing.

mailing:
Code:

#!/bin/bash

# "first@some.net,second@some.net" -- one e-mail to all (without spaces)
# "first@some.net, second@some.net" -- each e-mail separately (with spaces)
ADDRESSES="ADDRESSES.TXT"
MAIL="MAIL.TXT"

SUBJECT="This isn't a spam"

# "first -a second -a third" -- a few attachments
ATTACHMENT=""

SIGNATURE="~/.signature"
REPLY="me@own.org"

cat $MAIL > /tmp/mail
cat $SIGNATURE >> /tmp/mail

for address in `cat $ADDRESSES`
do
    if [ "$ATTACHMENT" != "" ]
    then
        nail -s "$SUBJECT" -a $ATTACHMENT -r $REPLY $address < /tmp/mail
    else
        nail -s "$SUBJECT" -r $REPLY $address < /tmp/mail
    fi
done

rm /tmp/mail


isn't it possible without script


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