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" user@example.com

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

Sfisioza
  • 592
  • 2
  • 8
  • 18

1 Answers1

1

Can you use sendmail? If so:

mymachine $ sendmail user@example.com <<EOM
> To: user@example.com
> From: me@example.com
> 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: user@example.com
> From: me@example.com
> 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 user@example.com
Sfisioza
  • 592
  • 2
  • 8
  • 18
Belmin Fernandez
  • 10,799
  • 27
  • 84
  • 148