Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 58614 invoked from network); 2 Oct 2008 13:07:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Oct 2008 13:07:46 -0000 Received: (qmail 50911 invoked by uid 500); 2 Oct 2008 13:07:33 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 50741 invoked by uid 500); 2 Oct 2008 13:07:33 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 50730 invoked by uid 99); 2 Oct 2008 13:07:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Oct 2008 06:07:33 -0700 X-ASF-Spam-Status: No, hits=-2.0 required=10.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of se.schneider@sap.com designates 155.56.68.140 as permitted sender) Received: from [155.56.68.140] (HELO smtpde03.sap-ag.de) (155.56.68.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Oct 2008 13:06:32 +0000 Received: from mail.sap.corp by smtpde03.sap-ag.de (26) with ESMTP id m92D771u010676 for ; Thu, 2 Oct 2008 15:07:07 +0200 (MEST) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C9248F.B500A635" Subject: Problem with JNDI Resources "JavaMail Sessions" Date: Thu, 2 Oct 2008 15:06:38 +0200 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Problem with JNDI Resources "JavaMail Sessions" Thread-Index: Ackkj7RriMfjSDrUREGHXKqnt+l1DA== From: "Schneider, Sebastian" To: X-OriginalArrivalTime: 02 Oct 2008 13:07:00.0945 (UTC) FILETIME=[C1F06410:01C9248F] X-Scanner: Virus Scanner virwal04 X-SAP: out X-Virus-Checked: Checked by ClamAV on apache.org ------_=_NextPart_001_01C9248F.B500A635 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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 =3D new InitialContext(); Context envCtx =3D (Context) initCtx.lookup("java:comp/env"); Session session =3D (Session) envCtx.lookup("mail/Session"); Message message =3D new MimeMessage(session); message.setFrom(new InternetAddress(request.getParameter("from")); InternetAddress to[] =3D new InternetAddress[1]; to[0] =3D 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 ------_=_NextPart_001_01C9248F.B500A635--