我找到了一些從 gmail 閱讀郵件的來源,例如:https ://javahowtos.com/guides/127-libraries/366-how-to-read-gmail-using-java-and-javax-mail.html
它非常有效,但我想在閱讀郵件時添加標簽。您知道我們可以在 gmail 中添加標簽https://support.google.com/mail/answer/118708?hl=en&co=GENIE.Platform=Desktop
javax郵件可以嗎?
uj5u.com熱心網友回復:
使用gmap解決:https ://mvnrepository.com/artifact/com.sun.mail/gimap
GmailMessage gmsg = (GmailMessage) message;
gmsg.setLabels(new String[]{"Label1"}, true);
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/496251.html
