-
-
Notifications
You must be signed in to change notification settings - Fork 271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Expand email builder API to support Content-Description on attachments #404
Comments
Why are you using a MimeBodyPart to add attachments?? |
@bbottema |
Simple Java Mail indeed does a conversion and only supports selected headers for attachments. Content-Description is not one of them (yet). I'm just wonder what you use this for, actually. I think this is the first time I see this header being used (on an attachment anyway). As far as I know it doesn't do anything, except for providing the given text in the resulting EML source, which is generally never inspected directly except for debugging purposes (and then still you have the attachment's name). Is Content-Description value extracted and used somewhere in your process? |
@bbottema Thanks for your detailed answer. |
And you are basing this conclusion on what grounds exactly? |
That we can not expect a new version? I'm not used to getting help so quickly. |
Well I wanted to look into it this morning, but then someone decided to drive into my car on the road so I had to deal with that. I hope I can take a look soon, though. |
Oh, that's annoying. Thank you! |
Would this work for you? String name = generateFilename(uuid, storno);
String description = storno ? "eAUStorno" : "eAU";
yourEmailBuilder
(..)
.withAttachment(name, new ByteArrayDataSource(xml, "text/plain"), description)
// or
.withAttachment(name, xml.getBytes(defaultCharset()), "text/plain", description)
(..)
.buildEmail(); |
Does it mean that AttachmentResource gets a field 'description', which could be initalized with constructor/setter?
Thanks for your effort! |
Released in 7.3.0! And yes, you can create AttachmentResources directly with descriptions too. |
Thank you very much for the quick help and reactions! |
Hello,
I want to send an email with an attachment. The attachment should contain as meta information a
Content-Description
. But my Content-Description header is ignored:MimeMessage: Date: Wed, 13 Jul 2022 12:40:46 +0200 (CEST)
From: xxxx
Reply-To: xxxx
To: "xxxx"
Message-ID: 747447859.1.1657708846687@xxxxx
Subject: TEAU0_eb24af60-51f3-45e7-ac7b-2abcc7cdba10
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_Part_0_1827369718.1657708846523"
X-KIM-Dienstkennung: eAU;Lieferung;V1.0
Disposition-Notification-To: xxxxxx
Return-Receipt-To: xxxxxx
------=_Part_0_1827369718.1657708846523
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
eAU
------=_Part_0_1827369718.1657708846523
Content-Type: application/octet-stream; filename=TEAU0_eb24af60-51f3-45e7-ac7b-2abcc7cdba10.p7s;
name=TEAU0_eb24af60-51f3-45e7-ac7b-2abcc7cdba10.p7s
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename=TEAU0_eb24af60-51f3-45e7-ac7b-2abcc7cdba10.p7s
Content-ID: <TEAU0_eb24af60-51f3-45e7-ac7b-2abcc7cdba10.p7s>
Here at the end for 'eAU'-section the 'Content-Description'-element should be added.
My code:
The 'Content-Type'-header is being processed, but the 'Content-Description' is ignored.
Version is 6.7.6
Any ideas how to solve my problem?
Thanks a lot for help!
The text was updated successfully, but these errors were encountered: