MCPcopy Index your code
hub / github.com/jordan-wright/email / writeMessage

Function writeMessage

email.go:347–364  ·  view source on GitHub ↗
(buff io.Writer, msg []byte, multipart bool, mediaType string, w *multipart.Writer)

Source from the content-addressed store, hash-verified

345}
346
347func writeMessage(buff io.Writer, msg []byte, multipart bool, mediaType string, w *multipart.Writer) error {
348 if multipart {
349 header := textproto.MIMEHeader{
350 "Content-Type": {mediaType + "; charset=UTF-8"},
351 "Content-Transfer-Encoding": {"quoted-printable"},
352 }
353 if _, err := w.CreatePart(header); err != nil {
354 return err
355 }
356 }
357
358 qp := quotedprintable.NewWriter(buff)
359 // Write the text
360 if _, err := qp.Write(msg); err != nil {
361 return err
362 }
363 return qp.Close()
364}
365
366func (e *Email) categorizeAttachments() (htmlRelated, others []*Attachment) {
367 for _, a := range e.Attachments {

Callers 1

BytesMethod · 0.85

Calls 1

CloseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…