MCPcopy
hub / github.com/dnote/dnote / queue

Method queue

pkg/server/mailer/backend.go:112–124  ·  view source on GitHub ↗

queue sends the email immediately via SMTP.

(subject, from string, to []string, contentType, body string)

Source from the content-addressed store, hash-verified

110
111// queue sends the email immediately via SMTP.
112func (b *DefaultBackend) queue(subject, from string, to []string, contentType, body string) error {
113 m := gomail.NewMessage()
114 m.SetHeader("From", from)
115 m.SetHeader("To", to...)
116 m.SetHeader("Subject", subject)
117 m.SetBody(contentType, body)
118
119 if err := b.Dialer.DialAndSend(m); err != nil {
120 return errors.Wrap(err, "dialing and sending email")
121 }
122
123 return nil
124}
125
126// StdoutBackend is an implementation of the Backend
127// that prints emails to stdout instead of sending them.

Callers 1

SendEmailMethod · 0.95

Calls 1

DialAndSendMethod · 0.65

Tested by

no test coverage detected