0

I am trying to send a 7Zip attachment using SMTP (java mail), even after setting proper multi-part and content type as "application/x-7z-compressed", I see it is not shown as attachment, as below, any suggestions what I could be missing ?

how the message is received

Sandeep
  • 199
  • 1
  • 4
  • 13

1 Answers1

0

Either something messed up the formatting of your post, or you pasted in an image. Either way, it's hard to see exactly what's going on with your message.

Try using the msgshow.java demo program included with JavaMail. It can show you the structure of a message. If it's not showing you what you expect, give us more details. In particular, what do you mean by "is not shown as an attachment"? What's doing the "showing"? Your mail reader?

Bill Shannon
  • 29,579
  • 6
  • 38
  • 40
  • Hi Bill, yes I have uploaded an image, when I say not showing I mean a web app (3rd party tool) similar to mail reader.
    I seem to have figured out the issue to be with content boundary. Same code works fine and my gmail shows and recongnizes my files as an attachment, while the tool I am mentioning does not.
    I saw the headers in detail on both gmail and this tool, and I see when gmail recognizes and shows a boundary like this `boundary="----=_Part_0_1582441433.1351802036515"`, but the tool does not show this, may be I should do fix this ?
    – Sandeep Nov 01 '12 at 21:10
  • 1
    Is the boundary value in the Content-Type header or not? I can't tell from what you pasted above. If it is, and it's correct, your mail reader web app is broken. If it's missing or incorrect, the message is broken, and you can set some JavaMail properties that will help work around the broken message. – Bill Shannon Nov 02 '12 at 03:09
  • Thanks Bill, I have just realized you are the author of MimeMultipart, (thanks for your time here firstly !!), no I am not setting boundary explicitly in Content-Type header, thats an auto-created one. Here's what I am doing ` Properties props = System.getProperties(); props.put("mail.mime.multipart.ignoreexistingboundaryparameter", true);` – Sandeep Nov 02 '12 at 03:42
  • And does it work? If not, and you need more help debugging this, it might be better to contact me at javamail_ww@oracle.com. What output did you get from the msgshow.java demo program? – Bill Shannon Nov 02 '12 at 16:54
  • Thanks a lot Bill, I suspect the issue is with the webapp, will mail you if I need further help on this. – Sandeep Nov 03 '12 at 15:35