go-gomail / gomail

The best way to send emails in Go.
MIT License
4.32k stars 572 forks source link

Embed/Attach files from URLs? #58

Open phedoreanu opened 8 years ago

phedoreanu commented 8 years ago

Hello,

I would like to send emails with embedded files from URLs.

SetCopyFunc only has access to io.Writer.

How would one replace os.Open with i.e http.Get?

crasm commented 7 years ago

I added some functionality for attaching/embedded from any data source (io.Reader). I believe it would let you make URLs less of a special case since you could pass the http.Response directly to AttachFromReader and EmbedFromReader.

https://github.com/crasm/gomail/commit/278dd7902726ff7796c2b1cab1119737e24241b5

kumarharsh commented 7 years ago

Was just looking for the same functionality for attaching user images in the emails. Good work @crasm. @alexcesaro would it be possible to merge this into the library?

crasm commented 7 years ago

@kumarharsh I think #78 solves this as well as my version, so that PR just needs to be approved.

kumarharsh commented 7 years ago

@crasm: see https://github.com/futurenda/gomail