make it harder to forget to set smtputf8 on message.Composer

we should do better: first gather all headers, and only write it when we start
on the body, and then calculate smtputf8 ourselves.
This commit is contained in:
Mechiel Lukkien
2024-03-16 20:54:10 +01:00
parent 8b2c97808d
commit cef83341e5
5 changed files with 37 additions and 34 deletions

View File

@ -91,7 +91,8 @@ func ExampleComposer() {
var b bytes.Buffer
// NewComposer. Keep in mind that operations on a Composer will panic on error.
xc := message.NewComposer(&b, 10*1024*1024)
const smtputf8 = false
xc := message.NewComposer(&b, 10*1024*1024, smtputf8)
// Catch and handle errors when composing.
defer func() {