Solved

How to eliminate tmp files for mailx

Posted on 2002-07-25
4
308 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

ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
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 how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

831 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