Operating System - HP-UX
1821544 Members
2248 Online
109633 Solutions
New Discussion юеВ

Re: Unix mail command with subject line

 
SOLVED
Go to solution
hpuxrox
Respected Contributor

Unix mail command with subject line

Hey,

I have a quick question about the mail command. I have the follow command line,

omnidb -session -since $DATE -detail | mail $EMAIL

What I want to do is put a suject in the email.

Anyone know how to do this?


Thanks

-Yates
7 REPLIES 7
Solution

Re: Unix mail command with subject line

Use mailx instead:

omnidb -session -since $DATE -detail | mailx -s "this is my subject line" $EMAIL

HTH

Duncan

I am an HPE Employee
Accept or Kudo
Pete Randall
Outstanding Contributor

Re: Unix mail command with subject line

Peter Kloetgen
Esteemed Contributor

Re: Unix mail command with subject line

Hi Yates,

simply add the -s "Your_subject" option to your mail command.

Allways stay on the bright side of life!

Peter
I'm learning here as well as helping
MANOJ SRIVASTAVA
Honored Contributor

Re: Unix mail command with subject line

Hi Yates

omnidb -session -since $DATE -detail | mail -s " SUBJECT " $EMAIL


Manoj Srivastava

Sanjay_6
Honored Contributor

Re: Unix mail command with subject line

Hi,

Try,

omnidb -session -since $DATE -detail | mailx -s "Subject Line" $EMAIL

Hope this helps.

Regds
Helen French
Honored Contributor

Re: Unix mail command with subject line

I would use either mailx or elm instead of mail:

# mailx -s "Subject" ...
# elm -s "Subject" ...
Life is a promise, fulfill it!
hpuxrox
Respected Contributor

Re: Unix mail command with subject line

Thanks got it.