[{"data":1,"prerenderedAt":600},["ShallowReactive",2],{"navigation":3,"\u002Fdocs\u002Fguides\u002Femail-size-limits\u002F":109,"\u002Fdocs\u002Fguides\u002Femail-size-limits\u002F-surround":595},[4,8,22,26,43,92],{"title":5,"path":6,"stem":7},"Getting Started","\u002Fdocs\u002Fgetting-started","1.docs\u002F1.getting-started",{"title":9,"path":10,"stem":11,"children":12,"page":21},"Setup","\u002Fdocs\u002Fsetup","1.docs\u002F2.setup",[13,17],{"title":14,"path":15,"stem":16},"Domain","\u002Fdocs\u002Fsetup\u002Fdomain","1.docs\u002F2.setup\u002F2.domain",{"title":18,"path":19,"stem":20},"Email","\u002Fdocs\u002Fsetup\u002Faccount","1.docs\u002F2.setup\u002F3.account",false,{"title":23,"path":24,"stem":25},"Email Testing API","\u002Fdocs\u002Fapi","1.docs\u002F3.api",{"title":27,"path":28,"stem":29,"children":30,"page":21},"Features","\u002Fdocs\u002Ffeatures","1.docs\u002F4.features",[31,35,39],{"title":32,"path":33,"stem":34},"Account","\u002Fdocs\u002Ffeatures\u002Faccount","1.docs\u002F4.features\u002F1.account",{"title":36,"path":37,"stem":38},"Mailbox","\u002Fdocs\u002Ffeatures\u002Fmailbox","1.docs\u002F4.features\u002F2.mailbox",{"title":40,"path":41,"stem":42},"Messages","\u002Fdocs\u002Ffeatures\u002Fmessage","1.docs\u002F4.features\u002F3.message",{"title":44,"path":45,"stem":46,"children":47,"page":21},"Guides","\u002Fdocs\u002Fguides","1.docs\u002F5.guides",[48,52,56,60,64,68,72,76,80,84,88],{"title":49,"path":50,"stem":51},"SMTP Test","\u002Fdocs\u002Fguides\u002Fsend-test-email","1.docs\u002F5.guides\u002F01.send-test-email",{"title":53,"path":54,"stem":55},"API Quickstart","\u002Fdocs\u002Fguides\u002Femail-testing-api","1.docs\u002F5.guides\u002F02.email-testing-api",{"title":57,"path":58,"stem":59},"CI","\u002Fdocs\u002Fguides\u002Fci","1.docs\u002F5.guides\u002F03.ci",{"title":61,"path":62,"stem":63},"Catch-All","\u002Fdocs\u002Fguides\u002Fcatch-all","1.docs\u002F5.guides\u002F04.catch-all",{"title":65,"path":66,"stem":67},"SPF, DKIM, DMARC","\u002Fdocs\u002Fguides\u002Fspf-dkim-dmarc","1.docs\u002F5.guides\u002F05.spf-dkim-dmarc",{"title":69,"path":70,"stem":71},"Playwright","\u002Fdocs\u002Fguides\u002Fe2e","1.docs\u002F5.guides\u002F06.e2e",{"title":73,"path":74,"stem":75},"Cypress","\u002Fdocs\u002Fguides\u002Fcypress","1.docs\u002F5.guides\u002F07.cypress",{"title":77,"path":78,"stem":79},"Email Clients","\u002Fdocs\u002Fguides\u002Femail-clients","1.docs\u002F5.guides\u002F08.email-clients",{"title":81,"path":82,"stem":83},"AI Agents","\u002Fdocs\u002Fguides\u002Fagents","1.docs\u002F5.guides\u002F09.agents",{"title":85,"path":86,"stem":87},"Local Development","\u002Fdocs\u002Fguides\u002Flocal-development","1.docs\u002F5.guides\u002F10.local-development",{"title":89,"path":90,"stem":91},"Size Limits","\u002Fdocs\u002Fguides\u002Femail-size-limits","1.docs\u002F5.guides\u002F11.email-size-limits",{"title":93,"path":94,"stem":95,"children":96,"page":21},"Alternatives","\u002Fdocs\u002Falternatives","1.docs\u002F6.alternatives",[97,101,105],{"title":98,"path":99,"stem":100},"Mailtrap","\u002Fdocs\u002Falternatives\u002Fmailtrap","1.docs\u002F6.alternatives\u002F1.mailtrap",{"title":102,"path":103,"stem":104},"Mailosaur","\u002Fdocs\u002Falternatives\u002Fmailosaur","1.docs\u002F6.alternatives\u002F2.mailosaur",{"title":106,"path":107,"stem":108},"Mailinator","\u002Fdocs\u002Falternatives\u002Fmailinator","1.docs\u002F6.alternatives\u002F3.mailinator",{"id":110,"title":111,"body":112,"description":589,"extension":590,"meta":591,"navigation":592,"path":90,"seo":593,"stem":91,"__hash__":594},"docs\u002F1.docs\u002F5.guides\u002F11.email-size-limits.md","Email Attachment Size Limits and Base64 Overhead",{"type":113,"value":114,"toc":584},"minimark",[115,119,124,127,138,141,209,212,216,305,311,314,339,343,346,349,400,418,494,502,551,554,580],[116,117,118],"p",{},"Most email size limits count the message as it travels, not the files you attached. Attachments are base64-encoded on the way, which makes them about 37% bigger.",[120,121,123],"h2",{"id":122},"the-encoding-overhead","The Encoding Overhead",[116,125,126],{},"SMTP carries text, so a binary attachment is base64-encoded: every 3 bytes become 4 characters, a third more. MIME then wraps the encoded text at 76 characters per line, and every line break adds 2 bytes:",[128,129,135],"pre",{"className":130,"code":132,"language":133,"meta":134},[131],"language-text","encoded size ≈ file size × 4\u002F3 × 78\u002F76 ≈ file size × 1.37\n","text","",[136,137,132],"code",{"__ignoreMap":134},[116,139,140],{},"The largest attachment that fits is about 73% of the limit, a little less once you count headers and the body:",[142,143,144,157],"table",{},[145,146,147],"thead",{},[148,149,150,154],"tr",{},[151,152,153],"th",{},"Message limit",[151,155,156],{},"Largest attachment, roughly",[158,159,160,169,177,185,193,201],"tbody",{},[148,161,162,166],{},[163,164,165],"td",{},"10 MB",[163,167,168],{},"7.3 MB",[148,170,171,174],{},[163,172,173],{},"20 MB",[163,175,176],{},"14.6 MB",[148,178,179,182],{},[163,180,181],{},"25 MB",[163,183,184],{},"18.3 MB",[148,186,187,190],{},[163,188,189],{},"30 MB",[163,191,192],{},"21.9 MB",[148,194,195,198],{},[163,196,197],{},"35 MB",[163,199,200],{},"25.6 MB",[148,202,203,206],{},[163,204,205],{},"40 MB",[163,207,208],{},"29.2 MB",[116,210,211],{},"Attachments share one limit. Two 10 MB files make a message of about 27 MB.",[120,213,215],{"id":214},"published-limits","Published Limits",[142,217,218,231],{},[145,219,220],{},[148,221,222,225,228],{},[151,223,224],{},"Service",[151,226,227],{},"Limit",[151,229,230],{},"Counts",[158,232,233,243,253,264,274,285,295],{},[148,234,235,238,240],{},[163,236,237],{},"Gmail, personal accounts",[163,239,181],{},[163,241,242],{},"Attachments on a sent message. Over the limit, Gmail swaps them for a Google Drive link",[148,244,245,248,250],{},[163,246,247],{},"Yahoo Mail",[163,249,181],{},[163,251,252],{},"All attachments in one message, sent or received",[148,254,255,258,261],{},[163,256,257],{},"Microsoft 365, Exchange Online",[163,259,260],{},"35 MB to send, 36 MB to receive",[163,262,263],{},"The whole message, by default. Admins can set anything from 1 to 150 MB",[148,265,266,269,271],{},[163,267,268],{},"Amazon SES",[163,270,205],{},[163,272,273],{},"The whole message after base64 encoding, over SMTP or the v2 API. The v1 API allows 10 MB",[148,275,276,279,282],{},[163,277,278],{},"SendGrid",[163,280,281],{},"Under 30 MB",[163,283,284],{},"The whole message, through the v3 Mail Send API",[148,286,287,290,292],{},[163,288,289],{},"Mailgun",[163,291,181],{},[163,293,294],{},"The whole message",[148,296,297,300,302],{},[163,298,299],{},"Postmark",[163,301,165],{},[163,303,304],{},"The whole message. The text and HTML bodies can be up to 5 MB each",[306,307,308],"note",{},[116,309,310],{},"From each provider's own help pages and documentation, checked November 2026. Google Workspace and Microsoft 365 admins can set different limits for their organization.",[116,312,313],{},"A message passes at least two of these limits: your provider's on the way out, and the recipient's on the way in. The smaller one wins. A 38 MB message that SES accepts still bounces at a Microsoft 365 mailbox on the default 36 MB receive limit.",[116,315,316,317,320,321,324,325,330,331,334,335,338],{},"Every SMTP server also states its own limit. Connect, send ",[136,318,319],{},"EHLO",", and the ",[136,322,323],{},"SIZE"," line in the reply is the maximum in bytes (",[326,327,329],"a",{"href":328},"\u002Fdocs\u002Fguides\u002Fsend-test-email\u002F#by-hand-with-openssl","how","). ",[136,332,333],{},"send.smtp.dev"," replies ",[136,336,337],{},"SIZE 20971520",", which is 20 MB.",[120,340,342],{"id":341},"testing-the-boundary","Testing the Boundary",[116,344,345],{},"Size bugs show up in two places: the message that's too big, and what your app does when a server refuses it. Both are easy to reproduce in the sandbox.",[116,347,348],{},"Make one file that fits and one that doesn't:",[128,350,354],{"className":351,"code":352,"language":353,"meta":134,"style":134},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","head -c 12000000 \u002Fdev\u002Furandom > fits.bin\nhead -c 18000000 \u002Fdev\u002Furandom > too-big.bin\n","bash",[136,355,356,383],{"__ignoreMap":134},[357,358,361,365,369,373,376,380],"span",{"class":359,"line":360},"line",1,[357,362,364],{"class":363},"sBMFI","head",[357,366,368],{"class":367},"sfazB"," -c",[357,370,372],{"class":371},"sbssI"," 12000000",[357,374,375],{"class":367}," \u002Fdev\u002Furandom",[357,377,379],{"class":378},"sMK4o"," >",[357,381,382],{"class":367}," fits.bin\n",[357,384,386,388,390,393,395,397],{"class":359,"line":385},2,[357,387,364],{"class":363},[357,389,368],{"class":367},[357,391,392],{"class":371}," 18000000",[357,394,375],{"class":367},[357,396,379],{"class":378},[357,398,399],{"class":367}," too-big.bin\n",[116,401,402,403,406,407,409,410,413,414,417],{},"Encoded, ",[136,404,405],{},"fits.bin"," is about 16 MB and goes through ",[136,408,333],{},". ",[136,411,412],{},"too-big.bin"," is about 25 MB, so the server refuses it with ",[136,415,416],{},"552",":",[128,419,421],{"className":351,"code":420,"language":353,"meta":134,"style":134},"swaks --server send.smtp.dev --port 587 --tls \\\n  --auth-user sender@test.example.com --auth-password \"$SMTP_PASSWORD\" \\\n  --from sender@test.example.com --to qa@test.example.com \\\n  --attach @too-big.bin\n",[136,422,423,447,469,485],{"__ignoreMap":134},[357,424,425,428,431,434,437,440,443],{"class":359,"line":360},[357,426,427],{"class":363},"swaks",[357,429,430],{"class":367}," --server",[357,432,433],{"class":367}," send.smtp.dev",[357,435,436],{"class":367}," --port",[357,438,439],{"class":371}," 587",[357,441,442],{"class":367}," --tls",[357,444,446],{"class":445},"sTEyZ"," \\\n",[357,448,449,452,455,458,461,464,467],{"class":359,"line":385},[357,450,451],{"class":367},"  --auth-user",[357,453,454],{"class":367}," sender@test.example.com",[357,456,457],{"class":367}," --auth-password",[357,459,460],{"class":378}," \"",[357,462,463],{"class":445},"$SMTP_PASSWORD",[357,465,466],{"class":378},"\"",[357,468,446],{"class":445},[357,470,472,475,477,480,483],{"class":359,"line":471},3,[357,473,474],{"class":367},"  --from",[357,476,454],{"class":367},[357,478,479],{"class":367}," --to",[357,481,482],{"class":367}," qa@test.example.com",[357,484,446],{"class":445},[357,486,488,491],{"class":359,"line":487},4,[357,489,490],{"class":367},"  --attach",[357,492,493],{"class":367}," @too-big.bin\n",[116,495,496,497,501],{},"For the message that arrived, the ",[326,498,500],{"href":499},"\u002Fdocs\u002Fapi\u002F#get-a-message","API"," reports the size of the message and of each attachment. Compare them with what your app attached:",[128,503,505],{"className":351,"code":504,"language":353,"meta":134,"style":134},"curl \"https:\u002F\u002Fapi.smtp.dev\u002Faccounts\u002F{accountId}\u002Fmailboxes\u002F{mailboxId}\u002Fmessages\u002F{id}\" \\\n  -H \"X-API-KEY: $SMTP_DEV_API_KEY\" | jq '{size, attachments: [.attachments[] | {filename, size}]}'\n",[136,506,507,521],{"__ignoreMap":134},[357,508,509,512,514,517,519],{"class":359,"line":360},[357,510,511],{"class":363},"curl",[357,513,460],{"class":378},[357,515,516],{"class":367},"https:\u002F\u002Fapi.smtp.dev\u002Faccounts\u002F{accountId}\u002Fmailboxes\u002F{mailboxId}\u002Fmessages\u002F{id}",[357,518,466],{"class":378},[357,520,446],{"class":445},[357,522,523,526,528,531,534,536,539,542,545,548],{"class":359,"line":385},[357,524,525],{"class":367},"  -H",[357,527,460],{"class":378},[357,529,530],{"class":367},"X-API-KEY: ",[357,532,533],{"class":445},"$SMTP_DEV_API_KEY",[357,535,466],{"class":378},[357,537,538],{"class":378}," |",[357,540,541],{"class":363}," jq",[357,543,544],{"class":378}," '",[357,546,547],{"class":367},"{size, attachments: [.attachments[] | {filename, size}]}",[357,549,550],{"class":378},"'\n",[116,552,553],{},"Then send the oversized message through your app and check what happens next:",[555,556,557,565,574],"ul",{},[558,559,560,564],"li",{},[561,562,563],"strong",{},"Check before sending."," Estimate the encoded size from the file sizes, and send a download link instead of an attachment past your provider's limit. That's what Gmail does with Drive.",[558,566,567,573],{},[561,568,569,570,572],{},"Treat ",[136,571,416],{}," as permanent."," Retrying a message that's too big fails the same way every time.",[558,575,576,579],{},[561,577,578],{},"Tell someone."," The person who triggered the email should learn it didn't go out.",[581,582,583],"style",{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}",{"title":134,"searchDepth":385,"depth":385,"links":585},[586,587,588],{"id":122,"depth":385,"text":123},{"id":214,"depth":385,"text":215},{"id":341,"depth":385,"text":342},"Why a 25 MB limit fits about 18 MB of attachments, the limits Gmail, Microsoft 365, SES, SendGrid, Mailgun, and Postmark publish, and how to test the boundary.","md",{},{"title":89},{"title":111,"description":589},"MhLnixAY_jcRUcB-1QMAMPstwfwh6ezzvPHDxFWt9uY",[596,598],{"title":85,"path":86,"stem":87,"description":597,"children":-1},"Mailpit, MailHog, MailCatcher, and smtp4dev catch email on your machine. What each one does, where localhost stops working, and when a hosted sandbox fits.",{"title":98,"path":99,"stem":100,"description":599,"children":-1},"Mailtrap's Email Sandbox and smtp.dev side by side on quotas, retention, and inbound addresses. When to stay on Mailtrap, and how to move a test suite.",1794185302165]