- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Send multiple attachments with sendmail
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-07-2007 10:04 PM
тАО03-07-2007 10:04 PM
Send multiple attachments with sendmail
I want to send multiple attachments from the sendmail utility (or any other e-mail utility in HP-UX).
I'm able to attach one file with the following script:
#! /usr/bin/ksh
# Arguments : -f
#For Eg. sendMail -t user@host.com -c user1@host1.com -s subject -b body -a attach.txt
while getopts 'f:t:c:s:b:a:' opt
do
case $opt in
f)
fromAddress=$OPTARG
;;
t)
toAddress=$OPTARG
;;
c)
ccAddress=$OPTARG
;;
s)
subject=$OPTARG
;;
b)
body=$OPTARG
;;
a)
attachment=$OPTARG
;;
:)
print "$OPTARG need an argument"
exit 1
;;
\?)
print "$OPTARG need a value"
exit 1
;;
esac
done
if [ -z "$toAddress" ] || [ -z "$subject" ] || [ -z "$body" ] || [ -z "$attachment" ]
then
print "Error: To Address, Subject and Body of the mail and attachment are required arguments"
exit 1
fi
if [ ! -f $attachment ] || [ ! -r $attachment ]
then
print "$attachment is not a readable file"
exit 1
fi
boundary='=== This is the boundary between parts of the message. ==='
{
print - "From: <${fromAddress}>"
print - "To: <${toAddress}>"
print - "Cc: <${ccAddress}>"
if [ -n $subject ]
then
print - 'Subject:' $subject
fi
print - 'MIME-Version: 1.0'
print - 'Content-Type: MULTIPART/MIXED; '
print - ' BOUNDARY='\"$boundary\"
print -
print -
print - "--${boundary}"
print - 'Content-Type: TEXT/PLAIN; charset=US-ASCII'
print -
cat $body
print -
print -
print - "--${boundary}"
print - 'Content-Type: TEXT/PLAIN; charset=US-ASCII; name='$attachment
print - 'Content-Disposition: attachment; filename='$attachment
print -
cat $attachment
print -
print - "--${boundary}--"
} | /usr/lib/sendmail "${toAddress} ${ccAddress}"
Could any body please help me how to do it for multiple attachments?
Thanks,
Vidhya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-07-2007 10:23 PM
тАО03-07-2007 10:23 PM
Re: Send multiple attachments with sendmail
Please see:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=708917
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=52454
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=79132
Please also read:
http://forums1.itrc.hp.com/service/forums/helptips.do?#33 on how to reward any useful answers given to your questions.
Your profile shows you have so far only rewarded 1 answer of 14 !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-07-2007 11:49 PM
тАО03-07-2007 11:49 PM
Re: Send multiple attachments with sendmail
uuencode tarball tarball | mailx -s "subject" to@me.org
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-08-2007 08:49 PM
тАО03-08-2007 08:49 PM
Re: Send multiple attachments with sendmail
by mail:
mail -t
From:
Cc:
bcc:
$(ux2dos test.txt|uuencode test.txt)
$(ux2dos test.html|uuencode test.html)
EOF
HTH,
Art
N.B. Please remeber to assign points
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-14-2007 04:19 AM
тАО03-14-2007 04:19 AM
Re: Send multiple attachments with sendmail
You have many fine examples here. Allow me to ads an additional set of examples in the attached.
Regards,
-dl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-24-2007 04:52 PM
тАО03-24-2007 04:52 PM
Re: Send multiple attachments with sendmail
Thanks Art... (I should have given more points to you :O))
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-24-2007 04:55 PM
тАО03-24-2007 04:55 PM