setHeader method Null safety

void setHeader(
  1. String name,
  2. String? value,
  3. {HeaderEncoding encoding = HeaderEncoding.none}
)

Sets a header with the specified name and value, replacing any previous header with the same name.

Compare MailConventions for common header names. Set encoding to any of the HeaderEncoding formats to encode the header.

Implementation

void setHeader(String name, String? value,
    {HeaderEncoding encoding = HeaderEncoding.none}) {
  _part.setHeader(name, value, encoding);
}