What is line length limit in an email body?

Still have a question, spotted an error, or have a better explanation or a source we should cite?

Email has a line length limit, and it matters more than you'd think. RFC 5322 (the spec that defines email format) says lines should be 78 characters or less, and must never exceed 998 characters. Go past 998 and mail servers will either fold your line (insert a line break mid-sentence) or reject the message entirely.

The 78-character guideline comes from ancient terminal displays that showed 80 columns. Email was designed to leave two characters for quote markers or line-ending sequences. The 998-character hard limit exists because early mail servers couldn't handle longer lines without breaking.

This breaks real emails in two common ways. First, if you're hand-coding HTML emails with long unbroken lines (think a massive <style> block with no line breaks), some servers will fold those lines mid-tag. Your CSS breaks, your layout collapses. Second, long URLs without breaks get folded mid-link. The URL splits across two lines, and suddenly your "Click here to reset your password" link 404s.

Most modern ESPs handle this automatically. Mailchimp, Brevo, Postmark, and others insert line breaks where needed before sending. But if you're sending raw SMTP (custom mail server, scripted sends, API calls to AWS SES or Mailgun without their SDKs), you're responsible for line length yourself.

If you're hitting this issue, it's usually because you're building email programmatically without proper encoding. The fix: use quoted-printable or base64 encoding for your email body. Both formats insert line breaks automatically and tell receiving servers how to reconstruct the original content. Most email libraries (like Python's email module or PHP's PHPMailer) handle this if you set the encoding correctly.

Worth checking if you're debugging broken links or mangled HTML. View the raw source of a sent email and look for lines longer than 998 characters. If you see any, your sending setup isn't folding lines properly. Our Source Analyzer can show you the raw MIME structure if you're stuck.

Contributors

Who worked on this answer

Every name links to their profile. Every company links to their site. Real people, real accountability.

Ask an AI · tailored to your setup

Not sure if your setup handles line length correctly?

I read this on the Email Almanac about email line length limits (RFC 5322's 78-character guideline and 998-character hard limit). Help me understand how this applies to MY specific situation. I need: 1. Is my current setup likely breaking this rule? Based on my ESP/platform and how I'm building emails, tell me if I need to worry about line length at all. 2. How do I check if I have a line length problem? What should I look for in my sent emails to know if lines are being folded incorrectly? 3. If I'm hand-coding or using API sends, what's the fix? Specific steps for my platform to ensure proper line folding or encoding. 4. How do I test this before sending to real subscribers? Tools or methods to validate my email source meets RFC 5322 line limits. --- My details (the more you share, the better the advice): - Email platform/ESP: e.g. Mailchimp, custom SMTP, AWS SES, Postmark - How I build emails: [drag-and-drop editor, hand-coded HTML, API with templates, plain text] - Sending method: ESP dashboard, SMTP library, direct API calls - Current issue: [broken links in emails, HTML layout breaking, server rejection errors] - Experience level: beginner / intermediate / advanced

Edit the yellow boxes, then send to the AI of your choice.