- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: send text file as an attachment
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
Forums
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
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
тАО04-30-2004 04:45 AM
тАО04-30-2004 04:45 AM
I am writing one script which generates a text file as an output. I need to send this output file as an attachment to the concerned people.
I tried using elm but I am not able to send the file as an attachment.
Can anyone please help me in this problem.
Thanks,
Anand.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-30-2004 04:57 AM
тАО04-30-2004 04:57 AM
Re: send text file as an attachment
http://hpux.ee.ualberta.ca/hppd/hpux/Users/mpack-1.5/
Mpack and munpack are utilities for encoding and decoding
(respectively) binary files in MIME (Multipurpose Internet Mail
Extensions) format mail messages.
Works great with text files...
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-30-2004 04:57 AM
тАО04-30-2004 04:57 AM
Re: send text file as an attachment
this works for me...
HTH
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-30-2004 05:00 AM
тАО04-30-2004 05:00 AM
Re: send text file as an attachment
Subject: ADD SUBJECT HERE
MIME-Version: 1.0
Content-type: multipart/mixed;boundary="zzzz"
Content-Transfer-Encoding: 7bit
--zzzz
Content-Type: text/plain; charset=US-ASCII; name="bdy.TXT"
Content-Disposition: inline; filename="bdy.TXT"
Content-Transfer-Encoding: 7bit
ADD BODY TEXT HERE
--zzzz
Content-Type: text/plain; charset=US-ASCII; name="FILENAME1.TXT"
Content-Disposition: inline; filename="FILENAME1.TXT"
Content-Transfer-Encoding: 7bit
ADD ASCII TEXT FOR FIRST ATTACHMENT HERE
--zzzz
Content-Type: text/plain; charset=US-ASCII; name="FILENAME2.TXT"
Content-Disposition: attachment; filename="FILENAME2.TXT"
Content-Transfer-Encoding: 7bit
ADD ASCII TEXT OF SECOND ATTACHMENT HERE
--zzzz--
#############################################
An example of the above method put to use (this is part of a larger shell script where the variables are defined):
## Send out e-mail notifications ##
echo "To: ${MAILTO}" >>/tmp/mymailfile.$$
echo "Subject: ${SUBJ}" >>/tmp/mymailfile.$$
echo "MIME-Version: 1.0" >>/tmp/mymailfile.$$
echo "Content-type: multipart/mixed;boundary=\"zzzz\"" >>/tmp/mymailfile.$$
echo "Content-Transfer-Encoding: 7bit" >>/tmp/mymailfile.$$
echo "" >>/tmp/mymailfile.$$
echo "--zzzz" >>/tmp/mymailfile.$$
echo "Content-Type: text/plain; charset=US-ASCII; name=\"${LOGFILE}\"" >>/tmp/mymailfile.$$
echo "Content-Disposition: attachment; filename=\"$(basename ${LOGFILE})\"" >>/tmp/mymailfile.$$
echo "Content-Transfer-Encoding: 7bit" >>/tmp/mymailfile.$$
echo "" >>/tmp/mymailfile.$$
cat ${LOGFILE} >>/tmp/mymailfile.$$
echo "" >>/tmp/mymailfile.$$
echo "--zzzz" >>/tmp/mymailfile.$$
if [ ${CNT} -eq 1 ]; then
echo "Content-Type: text/plain; charset=US-ASCII; name=\"${ARCHFILE}\"" >>/tmp/mymailfile.$$
echo "Content-Disposition: attachment; filename=\"$(basename ${ARCHFILE})\"" >>/tmp/mymailfile.$$
echo "Content-Transfer-Encoding: 7bit" >>/tmp/mymailfile.$$
echo "" >>/tmp/mymailfile.$$
cat ${ARCHFILE} >>/tmp/mymailfile.$$
echo "" >>/tmp/mymailfile.$$
echo "--zzzz" >>/tmp/mymailfile.$$
fi
cat /tmp/mymailfile.$$ | /usr/sbin/sendmail -t ${MAILTO}
rm /tmp/mymailfile.$$
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-30-2004 05:01 AM
тАО04-30-2004 05:01 AM
Re: send text file as an attachment
SYSTEM=$(uname -n)
(echo "Subject: ${SYSTEM} filename" ; uuencode filename.txt filename.txt) | /usr/sbin/sendmail user@somewhere.com,user1@somewhere.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-30-2004 05:05 AM
тАО04-30-2004 05:05 AM
Re: send text file as an attachment
Your file, myletter, should look something like this:
Hello.
This is some text.
[include myfile1 application/octet-stream base64]
This is some more text.
[include myfile2 application/octet-stream base64]
This is the end of my letter.
elm -s "My Subject" user@someplace.com < myletter
That will send myfile1 and myfile2 as attachments. I suspect the problem is that you have not created a .elm directory in the sender's home directory; the interactive version of elm will create that directory automatically but the command-line version will not.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-30-2004 05:37 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-30-2004 07:17 AM
тАО04-30-2004 07:17 AM
Re: send text file as an attachment
[include myfile text/plain base64]
elm -s "the file" you@dot.com
Rita