go-simple-mail v2.17.0 - TLS Enforcement and Attachment Fixes


go-simple-mail v2.17.0 was published on October 29, 2026. The release adds a mandatory TLS option, fixes AUTH LOGIN against strict SMTP servers, and changes how attachments are referenced by ContentID. Not a prerelease.

The full release notes and downloads are on the GitHub release page. This is a small library, but it sits under a lot of job schedulers and notification pipelines, so the changes below are worth a look before your next bump.

PR #123 adds a RequireSTARTTLS option. Previously the library could fall back to plaintext if the server did not advertise STARTTLS. With this option set, the send fails instead of negotiating down. If you send credentials or payload data over SMTP inside a trusted network segment, you can now make the TLS assumption explicit rather than implicit. Teams running mail relays on isolated subnets lose the silent downgrade path; that is the point.

PR #119 fixes AUTH LOGIN failures on strict SMTP servers. Strict relays reject malformed or out of order AUTH LOGIN exchanges, and the library’s handshake tripped them. If you run outbound mail through a relay with strict AUTH enforcement, this is the change most likely to affect you directly.

Three PRs reshape attachment behavior:

  • PR #98 adds an option to allow empty attachments. Useful when a pipeline step produces a zero byte file that still has to appear in the report mail.
  • PR #103 uses the provided ContentID for attachment lookup, and PR #120 preserves the ContentID in both file and base64 attachments. If you embed images in HTML mail bodies by CID, these two make the references stable.
  • PR #124 stops header folding before a long attachment filename. Long filenames no longer break the MIME headers, which matters when generated report filenames carry timestamps and job IDs.

PR #106 also skips the CID replacement pass when it is not needed, a small performance win on messages without inline images.

Two smaller changes stand out:

  • PR #97 adds a toggle to skip email address validation. Handy when you relay through a system that rewrites addresses and the library’s validator rejects the rewritten form.
  • PR #109 exposes the HasDSNExt flag so callers can tell whether a message was sent fire and forget or requested a delivery status notification. If you reconcile send outcomes from DSNs, this gives you the signal in code instead of parsing headers.
  • PRs #121 and #122 improve test quality: SMTP errors are now compared by code and message rather than err.Error(), and DSN NOTIFY parameter construction has coverage. Mostly internal test work, but it makes future regressions likelier to surface in CI.