package postman // Почтовое сообщения предназначенное для отправки type Message struct { to []string subject string body string contentType string attachments []Attachment } func NewMessage(subject string, body string) Message { return Message{ to: []string{}, subject: subject, contentType: "text/plain;charset=utf8", attachments: []Attachment{}, body: body, } } // Пополнение списка получателей func (m *Message) AppendRecipient(recipient string) error { m.to = append(m.to, recipient) return nil } // Пополнение списка вложений func (m *Message) AppendAttachment(file string) error { a := NewAttachment(file) m.attachments = append(m.attachments, a) return nil }