2

How can I send mail from the console marked with "priority high" flag?

Currently I'm using this syntax:

echo "message content" | mail -s "subject" [email protected]

I don't see any switches for this in man.

2

1 Answer 1

1

Can you use sendmail? If so:

mymachine $ sendmail [email protected] <<EOM
> To: [email protected]
> From: [email protected]
> Subject: Test mail `date +"%x %H:%M"`
> Importance: high    
> X-Priority: 1 (Highest)
> X-MSMail-Priority: High
> 
> Test message
> EOM

mymachine $

The text after > would be typed in on the newline. Of course, you could just pipe a text file:

mymachine $ cat > message
> To: [email protected]
> From: [email protected]
> Subject: Test mail `date +"%x %H:%M"`
> Importance: high
> X-Priority: 1 (Highest)
> X-MSMail-Priority: High
> 
> Test message
## CTRL+D ##

mymachine $ cat message | sendmail [email protected]

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .