tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacques Desodt <>
Subject Re: In webapp, sending multipart email with Javamail : noname attachment instead of message
Date Wed, 18 Apr 2012 13:44:48 GMT
Hi Chris,

Thanks a lot for your quick reply !
My apologies for the image posted, I didn't know
it could be stripped by the mailing list.
OK, I will test your solution tonight.

I agree with you, Javamail API is really complicated,
I always used Apache Commons Email.
I will have a look at your great project.


2012/4/18 Christopher Schultz <>

> Hash: SHA1
> Jacques,
> On 4/17/12 12:45 PM, Jacques Desodt wrote:
> > I try to send a Multipart email in a simple java method, using
> > Javamail. When i use the method in a local java app, everything is
> > fine. When i use the same method in a webapp hosted by Tomcat, i
> > got no message, but a file "noname" in attachment.
> Your code looks reasonable. I wonder if you are missing some system
> property when running under Tomcat, since you use the system
> properties as a basis for your JavaMail session setup.
> Try using an empty Properties object instead of taking
> System.getProperties() and mutating that. You might find that there is
> some property available in your standalone environment that you are
> missing in the Tomcat one.
> > And here are the results (i use gmail) :
> >
> > Images intégrées 1
> (I'm not sure what that means... if you attached something to your
> email, it was stripped by the mailing list).
> > The first (and wrong) email came from the Tomcat server. It has no
> > message, and an attachment with "noname" name. The other email is
> > good and came from my java app.
> What are the differences when you look at the actual source code of
> the message? You can learn a lot from looking at the raw MIME message.
> BTW, if you intend to move from a simple multipart text message as you
> have above to something more complicated (such as text + HTML +
> attachments) be aware that the JavaMail API is a complete main in the
> neck to use. I would highly recommend using a wrapper API such as
> commons-email or my own emailer wrapper you can find at
> I happen to like mine better ;)
> - -chris
> Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
> Comment: GPGTools -
> Comment: Using GnuPG with Mozilla -
> J58AnjuTcjIFhj1QOgESVmgMFK5jWOBC
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message