Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Use JavaMail API

354 views
Skip to first unread message

kumari...@gmail.com

unread,
Jul 25, 2018, 7:00:38 AM7/25/18
to
On Thursday, 28 January 1999 13:30:00 UTC+5:30, 전정일 wrote:
> I try to use JavaMail API...
> but, I run "java msgshow" then
>
> javax.mail.NoSuchProviderException: No provider for IMAP
> at javax.mail.Session.getProvider(Session.java:232)
> at javax.mail.Session.getStore(Session.java:306)
> at javax.mail.Session.getStore(Session.java:286)
> at msgshow.main(msgshow.java:23)
>
> I install javamail classpath (mail.jar) and pop3(pop3.jar)
>
> How to setup IMAP provider and POP3 provider?
>
> Thanks in advance

Hi ,
I am getting the same error msg , when I used Imap for mailreding . Colud you please assist me , How can I proceed and resolved this problem .

Error Msg -
javax.mail.NoSuchProviderException: No provider for imap
at javax.mail.Session.getProvider(Session.java:479)
at javax.mail.Session.getStore(Session.java:553)
at javax.mail.Session.getStore(Session.java:533)

and my code is -
Properties properies = new Properties();
properies.setProperty("mail.store.protocol","imaps");
Session emailSession= Session.getDefaultInstance(properies);
Store emailStore = emailSession.getStore("imaps");
emailStore.connect("imap.gmail.com","a...@gmail.com", password);

Thanks in Advance.

Kumari Meenu

Eric Sosman

unread,
Jul 25, 2018, 10:05:50 AM7/25/18
to
On 7/25/2018 7:00 AM, kumari...@gmail.com wrote:
> On Thursday, 28 January 1999 13:30:00 UTC+5:30, 전정일 wrote:
>> I try to use JavaMail API...
>> [...]
>
> I am getting the same error msg , when I used Imap for mailreding .
> [...]

(Nineteen and a half years between post and follow-up. Is
this a record?)

Try

https://javaee.github.io/javamail/FAQ.html#servletSecurityManager

or more generally,

https://javaee.github.io/javamail/FAQ.html

--
eso...@comcast-dot-net.invalid
Nine hundred ten days to go.

Eric Douglas

unread,
Jul 25, 2018, 11:40:38 AM7/25/18
to
On Wednesday, July 25, 2018 at 10:05:50 AM UTC-4, Eric Sosman wrote:
> (Nineteen and a half years between post and follow-up. Is
> this a record?)
>
> Try
>
> https://javaee.github.io/javamail/FAQ.html#servletSecurityManager
>
> or more generally,
>
> https://javaee.github.io/javamail/FAQ.html
>

That's not a follow up as in reply, just someone saying they have the same problem someone else had 19 years ago. While that API has changed a bit(I haven't heard of a pop3.jar), if you only specifically need Gmail I just use their API (https://developers.google.com/api-client-library/java/apis/gmail/v1).

Martin Gregorie

unread,
Jul 31, 2018, 8:49:13 PM7/31/18
to
Late reply (been away - just returned): I had that problem recently when
compiling code under Java 8 that was written and last compiled under Java
6 and that used the mstor provider to access mail held as multiple
messages in each file. The cure was simple: download the current mstor
source, compile it and use it. The problem seemed to be a change in the
the security managed to made it incompatible with old mstor jarfiles, so
presumably the same problem can happen with any old mail provider code.


--
Martin | martin at
Gregorie | gregorie dot org
0 new messages