Hello,
I'm using JavaMail to automatically send an email with a text attachment to a recipient.
The people who were supposed to receive the email has informed me that their system is unable
to read the message. Luckily they were nice enough to send me three SMTP dumps, with two mails
that they could read and one that their system failed to read.
Looking through the dump I've managed to conclude that the successful mails seems to send attachments without using multiparts, a snipped (from a successful mail) looks something like this:
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding:
7 bit
#BEGIN filename.txt
FROM: XXXXXX xxxx@xxxxxx.xxxx
ATTACHMENT FILE CONTENTS GOES HERE
ATTACHMENT FILE CONTENTS GOES HERE
ATTACHMENT FILE CONTENTS GOES HERE
#END
While a snippet from the mail that their system failed to read looked something like this:
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="b1_24475de5f9dca
3c4a2db2e4
60e99bf1f"
...
--b1_24475de5f9dca3c4a2db2
e460e99bf1
f
Content-Type: application/octet-stream; name="filename.txt"
Content-Transfer-Encoding:
base64
Content-Disposition: attachment; filename="filename.txt"
ATTACHMENT FILE CONTENTS GOES HERE
ATTACHMENT FILE CONTENTS GOES HERE
ATTACHMENT FILE CONTENTS GOES HERE
--b1_24475de5f9dca3c4a2db2
e460e99bf1
f--
I was using a MimeMultipart with my JavaMail to send my message and looking at the dump for those messages they look a lot more like the second (that is, its using multiparts)
Does anybody know how to send attachments without multiparts using JavaMail? Am I just supposed to use those #BEGIN and #END tags manually in my MessageBody string? Or might I have a different problem (multiparts aren't to blame) ?
//Henrik
Start Free Trial