Session.getInstance(props) question

View: New views
2 Messages — Rating Filter:   Alert me  

Session.getInstance(props) question

by Roger Duluth :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have application that connects to a mailbox using IMAP. It polls
periodically for new messages and replies back to email using SMTP. Is it
possible to two different SMTP servers in the same application?

I’m using currently using function Session.getInstance(props) to get session
instance.

my configuration:
Exchange-Server-1: IMAP1 and SMTP1 running
Exchange-Server-2: IMAP2 and SMTP2 running

TIA,
Roger

===========================================================================
To unsubscribe, send email to listserv@... and include in the body
of the message "signoff JAVAMAIL-INTEREST".  For general help, send email to
listserv@... and include in the body of the message "help".

Re: Session.getInstance(props) question

by Bill Shannon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Roger Duluth wrote:
> I have application that connects to a mailbox using IMAP. It polls
> periodically for new messages and replies back to email using SMTP. Is it
> possible to two different SMTP servers in the same application?
>
> I’m using currently using function Session.getInstance(props) to get session
> instance.

You can connect to multiple SMTP servers by using multiple Transport objects
that you manage explicitly, rather than depending on the Transport.send
static method.  If the servers need drastically different configurations,
you might want to use multiple Sessions.

===========================================================================
To unsubscribe, send email to listserv@... and include in the body
of the message "signoff JAVAMAIL-INTEREST".  For general help, send email to
listserv@... and include in the body of the message "help".