Solved

How to eliminate tmp files for mailx

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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 …
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
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.

743 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now