Hi Konstantin,

Good news, your solution is GREAT.
I looked at the libraries, and I saw geronimo-javamail_1.4_spec-1.7.1.jar
in the Tomcat lib folder (installed with CXF).
Removing it, everything works fine !

Thanks a lot,
Best regards,

Jacques

...and i'm using Tomcat 6.0.33 for this app :)



2012/4/18 Konstantin Kolinko <knst.koli...@gmail.com>

> 2012/4/18 Jacques Desodt <jdes...@gmail.com>:
> > Well, a little bit disappointed...
> > I changed my code :
> >
> >    public void sendTestMultipartMail(String host, final String username,
> > final String password, String from, String to) throws Exception {
> >
> >        Properties properties = new Properties();
> >        properties.put("mail.smtp.host", host);
> >        properties.put("mail.smtp.auth", "true");
> >        properties.put("mail.smtp.starttls.enable", "true");
> >        properties.put("mail.smtp.port", "587");
> >
> >        Session session = Session.getInstance(properties,
> >          new javax.mail.Authenticator() {
> >            protected PasswordAuthentication getPasswordAuthentication() {
> >                return new PasswordAuthentication(username, password);
> >            }
> >          });
> >
> >        Message msg = new MimeMessage(session);
> >
> >        msg.setFrom(new InternetAddress(from));
> >        msg.addRecipient(Message.RecipientType.TO, new
> InternetAddress(to));
> >        msg.setSubject("Test MultiPart Mail");
> >
> >        Multipart multipart = new MimeMultipart();
> >
> >        BodyPart part1 = new MimeBodyPart();
> >        part1.setText("This is multipart mail and u read part1......");
> >
> >        BodyPart part2 = new MimeBodyPart();
> >        part2.setText("This is multipart mail and u read part2......");
> >
> >        multipart.addBodyPart(part1);
> >        multipart.addBodyPart(part2);
> >
> >        msg.setContent(multipart);
> >
> >        Transport.send(msg);
> >    }
> >
> > -----------------------------------
> > Here is the raw message, sended by my local java app:
> >
> >(...)
> > ... and that's all...
> > Why ? I don't understand. Same method, same smtp server.
> > Any idea ?
>
> Different libraries?
>
> Try to check, what implementation is returned by those calls,
> Session.getInstance(..)
>
> Try running with a debugger,
>
> http://wiki.apache.org/tomcat/FAQ/Developing#Debugging
>
> Best regards,
> Konstantin Kolinko
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

Reply via email to