format method
Implementation
String format(Email email) {
final headers = [
"From: ${email.sender}",
"To: ${email.to.join(', ')}",
if (email.subject.isNotEmpty) "Subject: ${email.subject}",
"Content-Type: text/plain; charset=\"utf-8\"",
].join("\r\n");
return "$headers\r\n\r\n${email.message}\r\n.";
}