Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get important flag from Java Mail client

Tags:

jakarta-mail

Is there a way to get whether a mail is marked as important or not from Java Mail API.? I'm using a Gmail account to connect. Thanks in advance.

like image 288
Priyan Perera Avatar asked Feb 18 '23 01:02

Priyan Perera


1 Answers

Different mailers use different ways to indicate that a message is "important". Some use an X-Priority header. Others use an Importance header. I don't know offhand what Gmail uses, but look at the raw headers of a message and you should be able to figure it out. Then use the JavaMail getHeader method to access that header.

like image 117
Bill Shannon Avatar answered Apr 28 '23 12:04

Bill Shannon