mirror of
https://github.com/mjl-/mox.git
synced 2025-07-12 17:44:35 +03:00
use shorter smtp.NewAddress() instead of smtp.Address{...}
This commit is contained in:
@ -107,7 +107,7 @@ func ExampleComposer() {
|
||||
}()
|
||||
|
||||
// Add an address header.
|
||||
xc.HeaderAddrs("From", []message.NameAddress{{DisplayName: "Charlie", Address: smtp.Address{Localpart: "root", Domain: dns.Domain{ASCII: "localhost"}}}})
|
||||
xc.HeaderAddrs("From", []message.NameAddress{{DisplayName: "Charlie", Address: smtp.NewAddress("root", dns.Domain{ASCII: "localhost"})}})
|
||||
|
||||
// Add subject header, with encoding
|
||||
xc.Subject("hi ☺")
|
||||
|
@ -51,6 +51,6 @@ func From(elog *slog.Logger, strict bool, r io.ReaderAt, p *Part) (raddr smtp.Ad
|
||||
if err != nil {
|
||||
return raddr, nil, nil, fmt.Errorf("parsing localpart in from address: %v", err)
|
||||
}
|
||||
addr := smtp.Address{Localpart: lp, Domain: d}
|
||||
addr := smtp.NewAddress(lp, d)
|
||||
return addr, p.Envelope, textproto.MIMEHeader(header), nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user