Added GetGenHeader to the Msg to grant read access to set generic headers (e g. to use in Middlewares)

This commit is contained in:
Winni Neessen 2022-10-02 12:25:49 +02:00
parent 664aca5e90
commit cd2ee86846
Signed by: wneessen
GPG key ID: 385AC9889632126E

5
msg.go
View file

@ -478,6 +478,11 @@ func (m *Msg) GetRecipients() ([]string, error) {
return rl, nil return rl, nil
} }
// GetGenHeader returns the content of the requested generic header of the Msg
func (m *Msg) GetGenHeader(h Header) []string {
return m.genHeader[h]
}
// SetBodyString sets the body of the message. // SetBodyString sets the body of the message.
func (m *Msg) SetBodyString(ct ContentType, b string, o ...PartOption) { func (m *Msg) SetBodyString(ct ContentType, b string, o ...PartOption) {
buf := bytes.NewBufferString(b) buf := bytes.NewBufferString(b)