Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How do you use the JNDI ENC to access JavaMail?

enc javamail JNDI
0
Posted

How do you use the JNDI ENC to access JavaMail?

0

Location: http://www.jguru.com/faq/view.jsp?EID=75066 Created: Jun 14, 2000 Modified: 2000-06-14 07:30:41.03 Author: Steven Lau (http://www.jguru.com/guru/viewbio.jsp?EID=72026) Question originally posed by Se Hee Lee (http://www.jguru.com/guru/viewbio.jsp?EID=21287 First of all, you have to create a javax.mail.Session like you would in accessing other resources such as JDBC connections: InitialContext ctx = new InitialContext(); Session session = (Session) ctx.lookup(“java:comp/env/TheMailSession”); After that, everything else is the same: Message msg = new MimeMessage(session); … … Depending on the application server you’re using, you’ll have different ways in setting up the ENC.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123