Skip to content
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

Add support for attachments and inline attachments as bytes arrays. #87

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

guilespi
Copy link

Now only files were supported so if content was part of a stream it was necessary to pivot in a temporary file.

:content is assumed to be a byte array of a base64 encoded file.

Now only files were supported so if content was part of a stream it was necessary to pivot in a temporary file.

`:content` is assumed to be a byte array of a base64 encoded file.
(let [props (doto (Properties.)
(.load (io/input-stream pom)))]
(.getProperty props "version"))
""))
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't need to be part of the PR, it was failing running from then REPL

@@ -1,4 +1,4 @@
(defproject com.draines/postal "3.0.0-SNAPSHOT"
(defproject com.intception/postal "3.0.1"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not for the PR

(let [headers (doto (InternetHeaders.)
(.setHeader "Content-Transfer-Encoding" "base64"))]
(javax.mail.internet.MimeBodyPart. headers
(:content part))))
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming it's a byte-array not previously encoded, maybe the library could be doing the encoding itself.

Didn't want to add a new dependency to do that though, what's your take on it?

@vincent-dm
Copy link

vincent-dm commented Jan 17, 2018

Is anyone still looking at this? I have to attach send e-mails with inline images which are byte arrays and I really want to avoid the tmp-file route...

I created an alternate pull request: #96

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants