Solved

How to eliminate tmp files for mailx

Posted on 2002-07-25
4
309 Views
Last Modified: 2010-04-21
I know how to use mailx, sending the contents of a file out as the email message or "Body"  

Is there anyway I can do this without using the tmp files and in a way similar to how the "subject" line is populated?

Ideal example (let x be the body option for illustration):

mailx -s "Subject Line" -x "Body or email message" mailusers@unixmail.com

Thanks!
0
Comment
Question by:Randy2001
  • 2
  • 2
4 Comments
 
LVL 6

Expert Comment

by:bira
ID: 7178754
echo "Body or message"|mailx mailusers@unixmail.com
-s"subject Line"
0
 

Author Comment

by:Randy2001
ID: 7179987
bira,

That works! Thanks! I am going to accept your answer but before that could you tell me if its possible to add a message like you told me and then add the contents of a file.  

The email message (body) would look like this:

Here is my echo message

Here is the tmp file that I printed out with all kinds of wonderful ASCI text!

If not I will go ahead and accept you comment but if you can help I will add another 50.  Thanks!



0
 
LVL 6

Accepted Solution

by:
bira earned 75 total points
ID: 7180318
Randy2001
  Once you use the pipe (|), the mailx command interprets the input as the body or message.
 
   You could use as follow:
   
   cat yourfile | mailx mailusers@unixmail.com
-s"subject Line"

  But only one input. So i dont think it´s possible to do
  what you asked, using the pipe.

    Regards
0
 

Author Comment

by:Randy2001
ID: 7180352
OK.  Thanks anyway!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
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…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

828 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