Java mail API

K

Klaus Baumgart

Topic:Why can't a recipient using Lotus Notes see the attachment of my mail

created and sent with the JAVA Mail API?

Hi everyone,

I have created Multipart Message to send to different mail users. The

problem is now that the recipient using Lotus Notes can't see the

attachment, whereas Outlook has no problem. Here is my code snippet:



MimeMessage message = new MimeMessage(session);

message.setFrom(new InternetAddress("(e-mail address removed)"));

message.setRecipient(Message.RecipientType.TO,

new InternetAddress("(e-mail address removed)"));

Multipart multipart = new MimeMultipart();

//here I create the body content of the mail

String body = "<html><body>That's a test</body></html>";

BodyPart bodyPart = new MimeBodyPart();

bodyPart.setContent(body, "text/html");

multipart.addBodyPart(bodyPart);

//here I create one attachment for the mail

File file = new File("C:/test/ex.pdf");

InputStream is = new FileInputStream(file);

BodyPart attachmentBodyPart = new MimeBodyPart();

DataSource source = new ByteArrayDataSource(is, "application/x-any");

attachmentBodyPart.setDataHandler(new DataHandler(source));

attachmentBodyPart.setFileName("ex.pdf");

multipart.addBodyPart(attachmentBodyPart);

message.setContent(multipart);

javax.mail.Transport.send(message);



I would be very thankful if you could help me.<BR>

Regards, Klaus
 
I

isamura

: Topic:Why can't a recipient using Lotus Notes see the attachment of my mail
:
: created and sent with the JAVA Mail API?
:
: Hi everyone,
:
: I have created Multipart Message to send to different mail users. The
:
: problem is now that the recipient using Lotus Notes can't see the
:
: attachment, whereas Outlook has no problem. Here is my code snippet:
:
:
Could the problem be Notes setting to drop or disable attachments?

..k
 
K

Klaus Baumgart

No, it couldn't. Becourse Email which created by outlook comes with all
attachments to the lotus email-client.
 
T

Thomas Weidenfeller

Klaus said:
No, it couldn't. Becourse Email which created by outlook comes with all
attachments to the lotus email-client.

Then get such a working email, compare it (headers, structure, MIME
types, etc.) with a non-working one and figure out where they are different.

/Thomas
 
R

Roedy Green

I have created Multipart Message to send to different mail users. The

problem is now that the recipient using Lotus Notes can't see the

attachment, whereas Outlook has no problem. Here is my code snippet:

To solve that sort of problem you want to snoop on the message sent.
See http://mindprod.com/jgloss/sniffer.html

Look at messages that Lotus can eat and look at ones it can't. Once
you know the difference, you will be in a must better position to
bludgeon JavaMail into producing ones Lotus Notes likes.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,781
Messages
2,569,615
Members
45,297
Latest member
EngineerD

Latest Threads

Top