From fa602bef1326e8921fd7c0d17548900c9bb9a67a Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Sat, 13 Jan 2024 14:38:18 +0100 Subject: [PATCH] net/smtp: remove mention of crlf The docs states that lines needs to be CRLF terminated, but this isn't quite true. The package uses Writer.DotWriter() from the net/textproto package, which automatically does LF to CRLF conversion. Update the documentation to avoid people from cargo-culting CRLF conversion going forward. --- src/net/smtp/smtp.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/net/smtp/smtp.go b/src/net/smtp/smtp.go index b7877936da..b1fa724ca3 100644 --- a/src/net/smtp/smtp.go +++ b/src/net/smtp/smtp.go @@ -307,11 +307,11 @@ var testHookStartTLS func(*tls.Config) // nil, except for tests // The addresses in the to parameter are the SMTP RCPT addresses. // // The msg parameter should be an RFC 822-style email with headers -// first, a blank line, and then the message body. The lines of msg -// should be CRLF terminated. The msg headers should usually include -// fields such as "From", "To", "Subject", and "Cc". Sending "Bcc" -// messages is accomplished by including an email address in the to -// parameter but not including it in the msg headers. +// first, a blank line, and then the message body. The msg headers +// should usually include fields such as "From", "To", "Subject", +// and "Cc". Sending "Bcc" messages is accomplished by including an +// email address in the to parameter but not including it in the msg +// headers. // // The SendMail function and the net/smtp package are low-level // mechanisms and provide no support for DKIM signing, MIME