Your ROOT_URL in app.ini is http://git.slaventius.ru/ but you are visiting http://37.143.12.169/test3k/authPostman/blame/commit/f791d24ad73005de93628dc0a103ed2cab1a0794/internal/smtp/message.go You should set ROOT_URL correctly, otherwise the web may not work correctly.

36 lines
828 B

2 years ago
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
}