mirror of
https://github.com/nabbar/golib.git
synced 2025-10-24 08:13:48 +08:00
- smtp : refactor smtp packgage and allow connection context for smtp - mailer : add package for templating mail (using hermes lib) - mail : add package to format mal with header to be send to smtp (using lib smple mail) Add function in package : - errors : add function to retireve a map of minimal error code and package path of the getMessage function - version : add function to get root path of package (still existing but not return before this function) - ioutils : add function to expand bytes.buffer as io.ReadCloser interface
19 lines
291 B
Go
19 lines
291 B
Go
package mail
|
|
|
|
import "io"
|
|
|
|
// file represents the files that can be added to the email message.
|
|
type File struct {
|
|
name string
|
|
mime string
|
|
data io.ReadCloser
|
|
}
|
|
|
|
func NewFile(name string, mime string, data io.ReadCloser) File {
|
|
return File{
|
|
name: name,
|
|
mime: mime,
|
|
data: data,
|
|
}
|
|
}
|