Base64 MIME Encoding: How Email Attachments Are Encoded
MIME uses Base64 to embed binary attachments in plain-text email. Learn the MIME encoding format, line-length limits, and Content-Transfer-Encoding header.
Published:
Tags: encoding, developer-tools, base64
Base64 MIME Encoding: How Email Attachments Are Encoded When you send a PDF as an email attachment, the PDF bytes don't travel as raw binary. They're Base64-encoded into text, wrapped with metadata headers, and embedded in the email body. This encoding scheme — defined by MIME (Multipurpose Internet Mail Extensions) — is why email attachments are universally compatible, even with mail servers built in the 1970s. Here's exactly how it works. Why Email Needed MIME Original SMTP (Simple Mail Transfer Protocol, RFC 821, 1982) was designed for plain ASCII text. The specification stated that messages "consist of lines of ASCII characters." Binary data, non-ASCII characters, and attachments simply weren't part of the original design. As soon as people started sending files by email, the problems…
All articles · theproductguy.in