Click to See Complete Forum and Search --> : sending MAIL to multiple mail addresses


maxthree
03-01-2003, 12:44 PM
Hi
let' s say I have a file called text.dat

I want to send this file to x@hotmail.com and y@hotmail.com

What I do now is
cat text.dat | mail x@hotmail.com
cat text.dat | mail y@hotmail.com



anybody know the syntax to do this in one line?

also, if I send mails like this, they have no subject
anybody know the syntax for adding a subject to the mail ?

tks

bastard23
03-01-2003, 01:27 PM
cat test.dat| mail -s "Here is test.dat" x@hotmail.com y@hotmail.com
--or if test.dat is not a text file--
cat test.dat | uuencode test.dat | mail -s "Here is test.dat" x@hotmail.com y@hotmail.com

'man mail' for more info

Good Luck,
chris

edit: Had an extra space in the subject.

maxthree
03-01-2003, 01:58 PM
alas ...

cat verify.dat | mail -s "thanx chris" johan.steurs@codenet.be johan_steurs@skynet.be


-----Original Message-----
From: oper1@advisor0.codenet.be [mailto:oper1@advisor0.codenet.be]
Sent: samedi 1 mars 2003 18:50
Subject:


EC 300 :
--------
brt 7 2 await user H.E0 no call active
brt 7 1 await user H.E0 no call active

but i'll check the man pages ...

maxthree
03-01-2003, 02:04 PM
the plot thickens ...

$ cat verify.dat | mail -s "test" johan.steurs@codenet.be
test... User unknown
/export/home/oper1/dead.letter... Saved message in /export/home/oper1/dead.letters

z0mbix
03-01-2003, 03:04 PM
Try:

$ mail -s "test" johan.steurs@codenet.be < verify.dat

bastard23
03-01-2003, 03:22 PM
maxthree,

Try 'mailx' instead. The only thing I can think of is that you are not using the BSD mail command. What linux distro (or OS) are you using? Definately check the man page. Other commands to look at are mailx and Mail. Do a 'apropos mail' to see other mail commands. mail -s should be working, and the linux mail command has had it for a very long time. Using Sun's mail program (no -s option), you have to make the To: header your self. Try:

echo "Subject: Test"|cat - test.dat|mail usr1 usr2

qUseless info below:
I'm a little confused on the history, but -s is in 4.2BSD (circa 1983) and my mailx command (debian) is derived from the OpenBSD version. Thank you Debian (mailx README.Debian.gz) and PUPS (http://minnie.tuhs.org/PUPS/) (PDP Unix Preservation Society). The Solaris (only System V box I have close) mail command seems quite different than mailx, but they have the bsd mail in /usr/ucb.

If this is confusing, post again, and I'll try to explain better.

Good Luck,
chris

maxthree
03-01-2003, 04:04 PM
alas ....

$ mail -s "test" johan.steurs@codenet.be < verify.dat
test... User unknown
/export/home/oper1/dead.letter... Saved message in /export/home/oper1/dead.lette

as for the distro : it is not a linux but a unix machine
it runs the 'sh' (bourne) shell

I have no clue about what mail prog is used.
HW is ULTRASPARC5 so I suppose it's an older mail prog.

As for the man pages ...

$ man mail
No manual entry for mail.
$

maxthree
03-01-2003, 04:23 PM
GOT IT ...

argument -s does not work because it is f**ing Unix and not Linux.

Correct command thus ...

echo "Subject: thanks bastard23" | cat - verify.dat | mail johan.steurs@codenet.be

output :

-----Original Message-----
From: oper1@advisor0.codenet.be [mailto:oper1@advisor0.codenet.be]
Sent: samedi 1 mars 2003 21:15
Subject: thanks bastard23


EC 300 :
--------
brt 7 2 await user H.E0 no call active
brt 7 1 await user H.E0 no call active



Tks to all for the kind assistance ....

****ty that there are these small differences between Linux and Unix. These little differences keep you occupied for hours ....

bastard23
03-01-2003, 04:57 PM
maxthree,
Actually it's older problem than Linux. The problem is that Linux uses the BSD ('80s or earlier) mail program, and Solaris uses the ATT (dating back to the '70s) mail program (actually, that's how it's labeled in Irix man pages). I think the BSD mail program is easier. Linux is sometimes mismash of BSD, GNU, and SVR4/ATT (Solaris) commands.

Use 'Mail' or 'mailx' or /usr/ucb/mail.
These little differences keep you occupied for hours ....
Especially w/o man pages. You should see why you don't have them. Make sure MANPATH points to all your man pages, like /usr/man and such or don't set it at all. I'm off to figure out the tools used to parse Sun's SGML man pages. I had no idea they didn't use [tn]roff sources.... or maybe I'll just install Plan 9.

Have fun,
chris

P.S. uname -a to see system info (like version.) Many other uname options are system specific.