Hey guys, I found the solution.
I had import the wrong Session-class. So long, Sebastian > Hey Team, > > I have some problems with the example of JNDI Resources "JavaMail > Sessions". > > I get the error: The constructor MimeMessage(Session) is undefined > > A extract from the HOW-TO page: > Context initCtx = new InitialContext(); > Context envCtx = (Context) initCtx.lookup("java:comp/env"); > Session session = (Session) envCtx.lookup("mail/Session"); > > Message message = new MimeMessage(session); > message.setFrom(new InternetAddress(request.getParameter("from")); > InternetAddress to[] = new InternetAddress[1]; > to[0] = new InternetAddress(request.getParameter("to")); > message.setRecipients(Message.RecipientType.TO, to); > message.setSubject(request.getParameter("subject")); > message.setContent(request.getParameter("content"), "text/plain"); > Transport.send(message); > > I develop with Eclipse / Tomcat 6.0 and created a new Web Application. > > At first I modify my web descriptor (/WebContent/WEB-INF/web.xml) and > include the resource description. > > In the next step I downloaded the JavaMail API, included to the > Tomcat-Library and configure the resource factory > (Tomcat/lib/context.xml). > > Eclipse find the JavaMail API but it doesn't find the constructor in > this API. > > I hope you can help me. This is a new section for me. > > Best regards, > Sebastian > --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]