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

Per-Part Content-Transfer-Encoding? #47

Closed
daBrado opened this issue Dec 3, 2015 · 3 comments
Closed

Per-Part Content-Transfer-Encoding? #47

daBrado opened this issue Dec 3, 2015 · 3 comments

Comments

@daBrado
Copy link

daBrado commented Dec 3, 2015

I'd like to generate an email with a body and an attachment where each uses a different Content-Transfer-Encoding. Is this possible? It seems that each message part takes the value for the Content-Transfer-Encoding from the Message object's value for encoding, and are not independently settable.

Specifically, I want the body to have a Content-Type of "text/plain; format=flowed" with a Content-Transfer-Encoding of "8bit", and the attachment to have a Content-Type of "text/html" but with a Content-Transfer-Encoding of "quoted-printable". (I'd rather not have the format=flowed text be encoded as quoted-printable, since RFC 3676 says that it "should not" be so.)

I'm fine with manually encoding the data I give to SetBody and AddAlternative as 8bit and quoted-printable, respectively; I just need to be able set the Content-Transfer-Encoding on a per-part basis.

Is there a way to do that now? If not, does it seem like a reasonable thing to be able to do?

Thanks for any help.

@alexcesaro
Copy link
Member

I am currently a bit busy but I'll have a look at this issue soon.

@alexcesaro
Copy link
Member

That should be ok now using SetPartEncoding with SetBody or AddAlternative: https://godoc.org/github.com/go-gomail/gomail#example-SetPartEncoding

@daBrado
Copy link
Author

daBrado commented Dec 13, 2015

Neat; thank you!

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

No branches or pull requests

2 participants