Operating System - HP-UX
1834478 Members
3021 Online
110067 Solutions
New Discussion

Attaching multiple files to sendmail or mailx

 
Edcel Barcena
New Member

Attaching multiple files to sendmail or mailx

Is it possible to attached more than one file to a mail sent using sendmail or mailx? Please give an example. Thanks.
5 REPLIES 5
Joseph Loo
Honored Contributor

Re: Attaching multiple files to sendmail or mailx

hi,

u may like to refer to this thread:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=482848

regards.
what you do not see does not mean you should not believe
Gordon  Morrison
Trusted Contributor

Re: Attaching multiple files to sendmail or mailx

Example (from script) follows:

###########################
mailx -m -s "Your subject" -r fromaddress@yourdomain.co.uk address.one@otherdomain.org
.uk, address.two@yetanotherdomain.co
.uk, <<-EOF >$LOG 2>&1
To Whom it may concern

Please find attached Files for today

Please note this email was system generated

`ux2dos log.txt | uuencode log.txt`
`ux2dos log_errors.txt | uuencode log_errors.txt`

Our Company Name
EOF
###########################
You must uuencode all attachments.
ux2dos ensures that text attachments will be readable on a PC.
The -r flag to mailx specifies the reply-to address
What does this button do?
harry d brown jr
Honored Contributor

Re: Attaching multiple files to sendmail or mailx

for i in `echo filename1 filename2 filename3 ...` do uuencode $i $i.txt
done|mailx -m -s "test" username@whereever.com


live free or die
harry d brown jr
Live Free or Die
Rita C Workman
Honored Contributor

Re: Attaching multiple files to sendmail or mailx

Oh mailing attachment files is one of my favorite things...

Personally I like to use the include statement file with elm. I've used it to script sending multiple files that change everyday, and it worked nicely.

Here's one thread on it.
http://forums1.itrc.hp.com/service/forums/parseCurl.do?CURL=%2Fcm%2FQuestionAnswer%2F1%2C%2C0x41950559ff7cd4118fef0090279cd0f9%2C00.html&admit=716493758+1091120147036+28353475

Regards,
Rita
Dave La Mar
Honored Contributor

Re: Attaching multiple files to sendmail or mailx

Welcome to the forums.
As noted with a link in a previous post there are examples out there.
Attached is the latest doc of examples I keep handy.

Best of luck.

Regards,

dl
"I'm not dumb. I just have a command of thoroughly useless information."