Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mail command - switch to include a subject? 1

Status
Not open for further replies.

tonykent

IS-IT--Management
Jun 13, 2002
251
GB
I am using the following command on HPUX 10.20 to send the contents of a file to me in an email:

mail <address> </home/<user>/report.txt

It works fine but it would be nice to have it give a subject in the email - with the above command the email arrives with a blank subject. Everything I've managed to find about this suggests that

mail -s &quot;title&quot; <address> </home/<user>/report.txt

ought to work, but it does not appear to do so on HPUX 10.2.

Does anybody know if there is a switch I can use?
 
I could not get this to work with mailx. However the following does work on HP-UX 10.20

Use the command

mail user@email.address.com < test

Where test is the file to send. Make the first line of the test file to be something like

Subject: <Subject Text>
and make the second line blank (no spaces or anything). Begin with the email text on the third line.
 
when you do mailx -s &quot;test &quot; etc and press return
you do get a blank line , it waits for you to add in your text , once finished you need to press control D , this way it wants user interaction .

nice one


 
Thanks guys. I could not get the command to work with mailx either until I telnet'd in to the server. It works fine via telnet, but will not work when I go in using my (usual) exceed session! Still not worked that one out.....
 
Try the following command :

uuencode filename filename | mailx -ms'subject' mail_address

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top