javamail访问共享邮箱 [英] javamail access to a shared mailbox

查看:86
本文介绍了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.

这篇关于javamail访问共享邮箱的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆