classpathx-javamail
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Classpathx-javamail] sending emails with authentication


From: Chris Burdess
Subject: Re: [Classpathx-javamail] sending emails with authentication
Date: Mon, 27 Sep 2010 15:39:20 +0100

Daniel Rindt wrote:
> thanks for your efforts. This example is connecting via imaps to the
> mailserver properly seems. But covers not my use case, i want sending a
> email. 
> So i add a line like this:
> === 8< ===
> Transport transport = session.getTransport(url);
> === 8< ===
> I couldn't use imaps i got an exeption that no Provider is available
> for. So i use just imap for testing. But when i wan't the transport
> object it told me:
> === 8< ===
> javax.mail.NoSuchProviderException: invalid provider
> === 8< ===
> 
> So i would like to ask you if you can provide please a working example
> for sending emails with that server? Thanks.


IMAP is only a mail retrieval protocol, you cannot get a transport for this 
provider. You need a transport protocol like SMTP:

Transport transport = session.getTransport("smtp");

For how to send a message, see the testSendMessage method of 
test/src/TransportTest.java in the GNUMail distribution.
-- 
Chris Burdess





reply via email to

[Prev in Thread] Current Thread [Next in Thread]