Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

High Priority Mail using mailx

Tags:

unix

I have written the mailx command like this

echo "${BDY_MSG}" | mailx -r <from_address> -s <subject> <to_address>

Now I need to set the priority of this mail.How do I do that?

like image 870
sudipta06 Avatar asked Dec 23 '22 19:12

sudipta06


1 Answers

You'll have to look at your mailx manpage to see what options are accepted. Two solutions in increasing order of hack-iness:

  • If your mailx supports the -a option to add an additional header option, you can use -a "X-Priority:1".
  • If your mailx does not support the -a option, you can try to hack it in by using this trick from this other post by adding a newline to the subject: -s "$(echo -e "This is the subject\nX-Priority: 1")"
  • If neither of those work for you, you'll need to try another tool.
like image 195
Adam B Avatar answered Dec 27 '22 08:12

Adam B