go-gomail / gomail

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

Export some neccessary types to read info #195

Open Guest-615695028 opened 2 months ago

Guest-615695028 commented 2 months ago

We are expected to see exported types and fields to create MessageSetting, PartSetting, FileSetting, etc..

type Message struct {
    header      header
    parts       []*part
    attachments []*file
    embedded    []*file
    charset     string
    encoding    Encoding
    hEncoder    mimeEncoder
    buf         bytes.Buffer
}

type header map[string][]string

type part struct {
    contentType string
    copier      func(io.Writer) error
    encoding    Encoding
}

type file struct {
    Name     string
    Header   map[string][]string
    CopyFunc func(w io.Writer) error
}

type Message struct {
    Header      Header
    Parts       []*Part
    Attachments []*File
    Embedded    []*File
    Charset     string
    Encoding    Encoding
    Encoder     mime.WordEncoder
    Buf         bytes.Buffer
}

type Header map[string][]string

type Part struct {
    ContentType string
    Copier      func(io.Writer) error
    Encoding    Encoding
}

type File struct {
    Name     string
    Header   Header
    CopyFunc func(w io.Writer) error
}
Guest-615695028 commented 2 months ago

I tried to modify them myself, but what is the effect to the coupled components?