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

[Enhancement] Add another function export Bytes with all MIME headers field #108

Open
sixleaveakkm opened this issue Apr 14, 2020 · 0 comments

Comments

@sixleaveakkm
Copy link

I understand that bcc field (and maybe some other fields) should not be included when exported in most case.

Here is a problem, I try to use this libarary to build the raw message and then send it through Google API. The code is like following:

...

// build message content
e := email.NewEmail()
e.From = "[email protected]"
e.Subject = "foo"
e.Bcc = []string{"[email protected]", "[email protected]"}
e.Text = "bar content"
bytes, _ := e.Bytes()

// build gmail message
message := &gmail.Message{
     Raw: base64.URLEncoding.EncodeToString(bytes),
}
// send , "srv" is gmailService, from is the sender's id
_, err := srv.Users.Messages.Send(from, message).Do()
...

In this condition, all bcc are ignored since the function Bytes only includes needed MIMEHeaders, which bcc is not included.

Would you consider add another function aside Bytes which exports all MIMEHeaders?

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

1 participant