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

Create attachment using io.Reader or io.ReadCloser #145

Closed
kravemir opened this issue Feb 2, 2020 · 1 comment
Closed

Create attachment using io.Reader or io.ReadCloser #145

kravemir opened this issue Feb 2, 2020 · 1 comment

Comments

@kravemir
Copy link

kravemir commented Feb 2, 2020

gomail provides function to add attachment using filename:

func (m *Message) Attach(filename string, settings ...FileSetting)

However, this is very much limited to attachments from filesystem, not allowing other attachment content providers.

It would be useful, if it would be possible to add an attachment from:

  • io.Reader, which pretty much standard in golang, or
  • io.ReadCloser, which would provide shorter way for io.Readers sources, which need close (no need to make own defer,..), and any io.Reader can be converted to io.ReadCloser using ioutil.NopCloser,... or
  • []byte, which allows pretty much any attachment content source, but requires more work for callers.

Personally, I would prefer io.ReadCloser, which (in combination with ioutil.NopCloser) would create a versatile API covering the most of the use-cases.

@kravemir
Copy link
Author

kravemir commented Feb 4, 2020

Closing, as the project is unmaintained, mentioned in: #142, #104, and #108.

@kravemir kravemir closed this as completed Feb 4, 2020
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