- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: mailx and attachments
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
тАО04-08-2003 08:01 AM
тАО04-08-2003 08:01 AM
I have a MS Word document which I need to mail to a user as an attachment. I need to use mailx in a script.
The first step I did was to uuencode the document:
uuencode word.doc word.doc > word.enc
The I emailed it:
mailx -s "here is the doc" user < word.enc
However, the thing shows up as text in the body of the message, i.e.:
Here's the document Fred.
begin 666 26918877.doc
M;F%M92`@("`Z($9R960@36%R= ... etc
I checked, it's not the users mail program as he receives other Word docs OK.
Seems to have something to do with MIME which I know nothing about.
Can someone give me some direction please?
Fred
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-08-2003 08:13 AM
тАО04-08-2003 08:13 AM
Re: mailx and attachments
See Paula's answer in this thread:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x99da35067c18d6118ff40090279cd0f9,00.html
She doesn't use mailx, but sendmail should do the job for you.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-08-2003 08:13 AM
тАО04-08-2003 08:13 AM
Re: mailx and attachments
http://forums.itrc.hp.com/cm/QuestionAnswer/0,,0x720f36e69499d611abdb0090277a778c,00.html
See if it helps.
- ramd.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-08-2003 08:21 AM
тАО04-08-2003 08:21 AM
Re: mailx and attachments
mpack/munpack version 1.5 for unix
Mpack and munpack are utilities for encoding and decoding
(respectively) binary files in MIME (Multipurpose Internet Mail
Extensions) format mail messages. For compatibility with older forms
of transferring binary files, the munpack program can also decode
messages in split-uuencoded format.
http://hpux.ee.ualberta.ca/hppd/hpux/Users/mpack-1.5/readme.html
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-08-2003 08:26 AM
тАО04-08-2003 08:26 AM
SolutionHere's a sendmail script
#!/usr/bin/sh
export EMAIL_TO=
export EMAIL_FROM=
export EMAIL_SUBJECT="subject of e-mail"
export EMAIL_BODY=/etc/issue
export FILE_NAME=/etc/passwd.txt
export ATTACHED_FILE=/etc/passwd
{
echo To: $EMAIL_TO
echo From: $EMAIL_FROM
echo Subject: $EMAIL_SUBJECT
echo 'MIME-Version: 1.0'
echo 'Content-type: multipart/mixed; boundary="xxxxyyyzzqzzyyyxxxx"'
echo '--xxxxyyyzzqzzyyyxxxx'
echo ''
cat $EMAIL_BODY
echo '--xxxxyyyzzqzzyyyxxxx'
echo 'Content-Disposition: attachment; filename="'$FILE_NAME'"'
echo ''
cat $ATTACHED_FILE
echo '--xxxxyyyzzqzzyyyxxxx--'
} | /usr/sbin/sendmail $EMAIL_TO
HTH
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-08-2003 08:41 AM
тАО04-08-2003 08:41 AM
Re: mailx and attachments
Here's an old email that refers to using the 'include' statement. And it works great in a script sending 1 file or a dozen files.
The thread refers to some info on a 10.2 system...but I have boxes already at 11i and the same script works just fine.
Enjoy:
http://forums.itrc.hp.com/cm/QuestionAnswer/0,,0x41950559ff7cd4118fef0090279cd0f9,00.html
Rgrds,
Rita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-08-2003 08:47 AM
тАО04-08-2003 08:47 AM
Re: mailx and attachments
That's it exactly. That does work. So it does have something to do with MIME. Can I ask, the MIME parameters you set seem arbitrary, should I ask for detail or let it pass :)
Fred
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-08-2003 09:07 AM
тАО04-08-2003 09:07 AM
Re: mailx and attachments
Can you tell me the difference between the variables FILE_NAME and ATTACHED_FILE ??
Fred
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-08-2003 09:11 AM
тАО04-08-2003 09:11 AM
Re: mailx and attachments
Have you tried the threads that talk about using 'include' command. Try it...you might like it...
/rcw
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-08-2003 09:13 AM
тАО04-08-2003 09:13 AM
Re: mailx and attachments
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-08-2003 09:18 AM
тАО04-08-2003 09:18 AM
Re: mailx and attachments
Now the problem is, if it's a uuencoded document, passed as somename.doc, MS Office opens it but it still is uuencoded.
I tried using an actual Word document, not uuencoded, and got errors when Word tried to open it.
Fred
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-08-2003 09:25 AM
тАО04-08-2003 09:25 AM
Re: mailx and attachments
I think that was an example from a test
export FILE_NAME=/etc/passwd.txt
export ATTACHED_FILE=/etc/passwd
The FILE_NAME is the name of the attachment and the ATTACHED_FILE is as described. So essentially the same
As far as MIME is concerned , i'm not sure
HTH
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-08-2003 09:29 AM
тАО04-08-2003 09:29 AM
Re: mailx and attachments
format is:
mpack -s subject test.doc email.address
Trust me, it's the best thing since sliced bread :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-08-2003 09:36 AM
тАО04-08-2003 09:36 AM
Re: mailx and attachments
mailx is a messaging system.
sendmail and elm are true electronic mail systems.
Have you given elm a try??
/rcw
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-08-2003 10:21 AM
тАО04-08-2003 10:21 AM
Re: mailx and attachments
I am helping a vendor debug a procedure they use to deliver documents via email. I have an interest because I'm one of their customers with issues - if I can nail this down it'll fix my problem and possibly help them.
They have multiple OS's in their user base, and I can't control which mailer they use - hence I'm trying to find something that uses mailx if possible, sendmail as a fallback.
Fred
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-08-2003 11:31 AM
тАО04-08-2003 11:31 AM
Re: mailx and attachments
If there is then Steve's script with MIME parameters may work.
For example, is there a Content-type for uuencoded docs?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-09-2003 02:31 AM
тАО04-09-2003 02:31 AM
Re: mailx and attachments
Found these for you
sendmail: How to send attachments; Use uuencode (or mime)
http://www4.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000062943010
Here's the docid from the info that I provided
http://www4.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000062684425
HTH
Steve