mailx command (Sun Solaris 8)

Hi,

I would like to use mailx to send multiple files to one recipient whereas each file should be send as a separate email.

mailx -s "Subject" email@user.de < file1 file2 file3 file4

If I use this command email@user.de will receive only file4.
And: cat file* | mailx -s .... will combine everything to one email!

Could you please give me a hint how to manage this?

Thanks in advance!!

You should simply use a loop - either a for , while, or until loop should work fine. You would possibly need a counter which you can set up easily (set counter = 1 or 0 , increment it on each pass through the loop, stop the loop when the counter is equal or greater than the number of files)

Syntax is...

for File in file*
do
mailx -s "Subject" email@user.de < $File
done