Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 82956 invoked from network); 22 Aug 2007 08:23:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Aug 2007 08:23:52 -0000 Received: (qmail 18040 invoked by uid 500); 22 Aug 2007 08:23:45 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 17971 invoked by uid 500); 22 Aug 2007 08:23:45 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 17961 invoked by uid 99); 22 Aug 2007 08:23:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Aug 2007 01:23:45 -0700 X-ASF-Spam-Status: No, hits=3.5 required=10.0 tests=HTML_MESSAGE,SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of apacheben@gmail.com designates 64.233.182.184 as permitted sender) Received: from [64.233.182.184] (HELO nf-out-0910.google.com) (64.233.182.184) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Aug 2007 08:23:43 +0000 Received: by nf-out-0910.google.com with SMTP id d3so69641nfc for ; Wed, 22 Aug 2007 01:23:22 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:references:x-google-sender-auth; b=NycUElASMIViZFAJ+rhdo9/eAICfZY04i4CcFNUK5C/VWfeMYoW4D6K3viiTS8fEJEKRWN06uOOK3g86ufF/6fVGsOp1sPCrNJo38I5vyMoplLxQUf+TVB5GFNcB3FuQ48xSVnMGpOHG5uXSAB2S+zzbP5e+aGblJguaXCiU3X8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:references:x-google-sender-auth; b=hChDHgxy806suaNqw+laURg5gruAyluxK7+57rD5yeNtDBqqCZ2+dXAO8+sgSFm+Ezh+AAWcXVtwFobAmeyKoI0GZ1fpvs0Fzs0pMLDrnmE22cmCLkf0LPp5JM+dYsyZme3GrX738ltiLkE4m2M64zRsOv8wAe6ITnVG1WCuwiA= Received: by 10.78.166.7 with SMTP id o7mr286151hue.1187771001209; Wed, 22 Aug 2007 01:23:21 -0700 (PDT) Received: by 10.78.177.2 with HTTP; Wed, 22 Aug 2007 01:23:21 -0700 (PDT) Message-ID: <6185d22e0708220123i60adf74v9c3801d674c62517@mail.gmail.com> Date: Wed, 22 Aug 2007 01:23:21 -0700 From: "Ben Speakmon" Sender: apacheben@gmail.com To: "Jakarta Commons Users List" Subject: Re: [noob] e-mail : setting the content-type of the body In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_139029_5709724.1187771001127" References: <6185d22e0708211103m1e21b848u6aea65f80cc5740b@mail.gmail.com> X-Google-Sender-Auth: 6f77a657f509374d X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_139029_5709724.1187771001127 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Ah, I see. MultiPartEmail.setSubType() sets the MIME subtype of the parent MimeMultipart container. Every MultiPartEmail and HtmlEmail object is built around a multipart/mixed or multipart/related. It's breaking for you becaus= e you're trying to set the content type to "multipart/application/wdxx", and that's obviously not going to work. You probably don't want to call that method at all. I assume you want the WDXX part to be the "content" of the message, not one of the attachments. Try Email.setContent(Object o, String contentType) and specify the content type as application/wddx. Let me know how that works. --Ben On 8/22/07, Pierre Goupil wrote: > > Hello, > > Sure. Here it is : > > ************************************** > org.apache.commons.mail.EmailException: Sending the email to the followin= g > server failed : smtp.orange.fr:25 > at org.apache.commons.mail.Email.sendMimeMessage(Email.java:873) > at org.apache.commons.mail.Email.send(Email.java:898) > at com.gossinteractive.templates.contribute.ContributeBean.sendMail( > ContributeBean.java:736) > at > com.gossinteractive.templates.contribute.ContributeBean.processFiles( > ContributeBean.java:656) > at com.gossinteractive.templates.contribute.ContributeBean.start( > ContributeBean.java:84) > at com.gossinteractive.icm4j.Icm4jContext.addAndExecuteAction( > Icm4jContext.java:449) > at com.gossinteractive.icm4j.Icm4jContext.loadAndExecuteActions( > Icm4jContext.java:493) > at com.gossinteractive.icm4j.Icm4jContext.start(Icm4jContext.java > :1336) > at com.gossinteractive.icm4j.jsf.Icm4jJsfServlet.forwardRequest( > Icm4jJsfServlet.java:128) > at com.gossinteractive.icm4j.http.Icm4jHttpServlet.doWork( > Icm4jHttpServlet.java:269) > at com.gossinteractive.icm4j.http.Icm4jHttpServlet.doPost( > Icm4jHttpServlet.java:312) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:710) > at com.gossinteractive.icm4j.http.Icm4jHttpServlet.service( > Icm4jHttpServlet.java:366) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) > at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( > ApplicationFilterChain.java:269) > at org.apache.catalina.core.ApplicationFilterChain.doFilter( > ApplicationFilterChain.java:188) > at org.apache.catalina.core.StandardWrapperValve.invoke( > StandardWrapperValve.java:210) > at org.apache.catalina.core.StandardContextValve.invoke( > StandardContextValve.java:174) > at org.apache.catalina.core.StandardHostValve.invoke( > StandardHostValve.java:127) > at org.apache.catalina.valves.ErrorReportValve.invoke( > ErrorReportValve.java:117) > at org.apache.catalina.core.StandardEngineValve.invoke( > StandardEngineValve.java:108) > at org.apache.catalina.connector.CoyoteAdapter.service( > CoyoteAdapter.java:151) > at org.apache.coyote.http11.Http11Processor.process( > Http11Processor.java > :870) > at > > org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.proce= ssConnection > (Http11BaseProtocol.java:665) > at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket( > PoolTcpEndpoint.java:528) > at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt( > LeaderFollowerWorkerThread.java:81) > at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run( > ThreadPool.java:685) > at java.lang.Thread.run(Thread.java:595) > Caused by: javax.mail.internet.ParseException > at javax.mail.internet.ParameterList.(ParameterList.java:81) > at javax.mail.internet.ContentType.(ContentType.java:82) > at javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java > :1108) > at javax.mail.internet.MimeMessage.updateHeaders(MimeMessage.java > :1930) > at javax.mail.internet.MimeMessage.saveChanges(MimeMessage.java:1911) > at javax.mail.Transport.send(Transport.java:79) > at org.apache.commons.mail.Email.sendMimeMessage(Email.java:863) > ... 27 more > > ************************************** > > Unfortunately, it doesn't want to display a longer stacktrace. > > Again, this exception occurs only when performing an > "email.setSubType("application/wddx")". > Without it, the e-mail is sent, but it seems that my processing back-end > needs it. > > I hope this helps you to help me :) > > Pierre > > > > > > 2007/8/21, Ben Speakmon : > > > > Hi Pierre, > > > > Can you post the actual exception you get when you try it? > > > > --Ben > > > > On 8/21/07, Pierre Goupil wrote: > > > > > > Hello all, > > > > > > I'm currently playing around with commons e-mail. I'm using it to sen= d > > > e-mails to a server with a WDDX body and some file attachements. FYI > > WDDX > > > is > > > a sub-set of XML from Macromedia / Allaire. > > > > > > It all works fine except for one thing : I would like to be able to > tell > > > to > > > the server (which will be dealing with the e-mail) that the body is > > WDDX. > > > > > > Is there a way to achieve this ? I've tried with : > > > email.setSubType("application/wddx") > > > but it gives me a parse exception. > > > > > > Thanks in advance, > > > > > > Pierre > > > > > > > > > -- > "Si le sang ne coule pas assez chaud dans tes veines, > je le r=E9pandrais sur le sable pour qu'il bouille au soleil." > > (Maraxus de Kelde) > ------=_Part_139029_5709724.1187771001127--