javamail访问共享邮箱
我正在尝试编写一个Java应用程序,该应用程序将访问附加的共享邮箱以阅读电子邮件并执行其他活动.我可以很方便地阅读自己的INBOX(或其文件夹和内容),但是很难找到有关如何访问(并最终解析/读取)共享邮箱的信息.
I'm trying to write an java application that will access a additional, shared mailbox to read emails and perform other activities. I have no problem reading my own INBOX (or its folders & contents) but am having great difficulty finding information on how to access (and ultimately parse/read) a shared mailbox.
我正在执行以下操作,并且对我来说效果很好
I am doing the following and it is working fine for me
properties = System.getProperties();
properties.setProperty("mail.imaps.auth.plain.disable", "true");
properties.setProperty("mail.imaps.auth.ntlm.disable", "true");
Session session = Session.getInstance(properties, null);
store = session.getStore("imaps");
store.connect("HOST", PORT, "DOMAIN\\USER\\SHAREDACCOUNT","pwd");
这里
DOMAIN \\ USER \\ SHAREDACCOUNT会像这样
假设电子邮件帐户是tarun@abc.com,那么
abc \\ tarun \\ shared_MB
Here
DOMAIN\\USER\\SHAREDACCOUNT would be like this
suppose email account is tarun@abc.com then
abc\\tarun\\shared_MB
您还必须输入tarun@abc.com帐户的密码.
You also have to enter the password of tarun@abc.com account.