LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-03-2010, 04:27 AM   #1
birla.sunil
LQ Newbie
 
Registered: Oct 2010
Posts: 20

Rep: Reputation: 0
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
 
Old 11-03-2010, 07:18 AM   #2
mlangdn
Senior Member
 
Registered: Mar 2005
Location: Kentucky
Distribution: Slackware64-current
Posts: 1,432

Rep: Reputation: 196Reputation: 196
Why don't you start with:

Code:
$ man mail
and do a little reading?
 
Old 11-03-2010, 08:08 AM   #3
w1k0
Senior Member
 
Registered: May 2008
Location: Poland
Distribution: Slackware, Mint
Posts: 1,252

Rep: Reputation: 205Reputation: 205Reputation: 205
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
 
Old 11-04-2010, 01:38 AM   #4
birla.sunil
LQ Newbie
 
Registered: Oct 2010
Posts: 20

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by mlangdn View Post
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
 
Old 11-04-2010, 01:39 AM   #5
birla.sunil
LQ Newbie
 
Registered: Oct 2010
Posts: 20

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by w1k0 View Post
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
script to read email then download attachment dtra Linux - Software 0 05-24-2005 08:03 PM
mail -a would not work to send e-mail attachment saavik Linux - Networking 3 12-18-2003 09:33 AM
mail with attachment joseph Linux - Networking 1 08-31-2003 10:01 PM
ximian evolution attachment download kc8tbe Linux - Software 6 05-05-2003 06:50 PM
Attach a Attachment with the " mail command" robinhood1995 Linux - General 2 05-16-2002 11:06 AM


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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration