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
.
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
.
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