Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Unix mailx attachment syntex

Posted on 2000-03-13
12
75,879 Views
Last Modified: 2011-08-18
Looking for syntex for mailx command to have file go as an attachment.
When sending file as text I type
mailx -s "My Email Topic" johndoe@somesite.com < mytext.txt
and the text appears as the body of the email.
What would be the syntex to have mytext.txt be an attached file?
0
Comment
Question by:widrzk
  • 4
  • 2
  • 2
  • +3
12 Comments
 

Author Comment

by:widrzk
ID: 2613052
Adjusted points to 150
0
 
LVL 40

Expert Comment

by:jlevie
ID: 2613240
mailx can't do attachments. For that you'd need a client program that understands how to create MIME messages. Pine (http://www.washington.edu/pine) can be used on most any Unix and it knows how to do attachements.
0
 
LVL 14

Accepted Solution

by:
mcrider earned 150 total points
ID: 2613405
Actually, mailx CAN do attachments... Just UUECODE the file you are going to attach and then append the uuencoded file at the end of the body of the message.  Make sure you put a blank line between the last message line and the start of the uuencoded file...



Cheers!®©
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 40

Expert Comment

by:jlevie
ID: 2613460
Well, that's sort of true and it depends on what the addressee's mail client can do and/or how much work the addressee has to go through to get to the uuencoded data. I suspect that what the questioner wants is to have true multi-part messages.
0
 
LVL 14

Expert Comment

by:mcrider
ID: 2613564
jlevie,

Not sort of true... IS true.  widrzk never asked anything about multi-part messages, just wanted to attach a file.

Almost every mail client built is able to handle uuencoded attachments.  In fact, alot of them DONT handle MIME.


Cheers!®©
0
 

Author Comment

by:widrzk
ID: 2613615
Referenced uuencode man page on unix.  The path comment was a little vague.  Basically I used as:
uuencode testfile.txt testfile.dat > testfile.dat
where testfile.txt is the file to be encoded,
testfile.dat - becomes the name of the attachment
and > testfile.dat - the piped encoded file.

Used emailbody.txt as the body of the message,
blanklines.txt to separate.  Appended all by:

cat emailbody.txt blanklines.txt testfile.dat > email.msg

Then send syntex:
mailx -s "Test Email UUENCODE Attachment" somebloke@somewhere.com < email.msg

Came out fine.  Thanks
0
 
LVL 14

Expert Comment

by:mcrider
ID: 2613660
Thanks for the points... Glad I could help!


Cheers!®©
0
 

Expert Comment

by:charliesweet
ID: 7381811
Hi,

Attachments can be sent via mailx and all kinds of attachments can be sent.

Syntax:

(uuencode AAA AAA )| mailx -s "subject" a@b.com

here AAA is the file you want to send as attachment. I would like you to write this with the extension also. it mite get junked otherwise.

Hope this helps.

- charlie -
0
 

Expert Comment

by:shiva_kalidindi
ID: 12604551

Hi,

I would like to send two files as seperate attachments in a mail. how can i do this using mailx in AIX 5.0?

thanks,
Shiva
0
 
LVL 1

Expert Comment

by:kampol_t
ID: 24485177
Hi charliesweet,

I tried your syntex

(uuencode AAA AAA )| mailx -s "subject" a@b.com

on SCO Openserver 6. It does not work. What os r u using?

Thanks.
0
 
LVL 1

Expert Comment

by:kampol_t
ID: 24485253
Hi,

I followed 'mcrider' comments, it works!

Thanks.
0
 
LVL 14

Expert Comment

by:mcrider
ID: 24498908
kampol_t .... Thanks! Glad I could help.
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
pauing printer deamon in AIX 10 63
Vmware Vswitch  VS  Redhat  Bridge 1 114
Write an app 10 70
How should I mount this 3 TB USB Hard disk to my Linux server? 9 119
I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

789 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question