Forcing Gmail to send email with zero margins
By default, it is not possible to send email with content as backgrounds or images taking up the whole width of email space. However, it is possible to do so with the following little trick.
This comes in handy when you want to resend e.g. nicely‑formatted Mailchimp e‑mail and still retain its full‑width layout (recall those wonderful header and footer images with no right‑ and left‑ margins!).
Solution
The procedure consist in directly altering e‑mail HTML code before sending it. To do so, you need some browser extension that will allow you to do this. The add‑on I used was cloudHQ's Free HTML Editor for Gmail. So:
- Install Free HTML Editor for Gmail Chrome extension
- Open the e‑mail draft you want to edit.
- Click
Edit as HTML
icon added by the extension - On the top of the email, write:
<style> body, #bodyTable, #bodyCell { height:100%; margin:0; padding:0; width:100%; } :root { color-scheme: light only; } </style> <meta name="viewport" content="width=device-width, initial-scale=1" class=""> <meta name="color-scheme" content="light only">
- The
<style>
‑tag first part will remove the borders for desktop clients. - The
viewport
meta tag will achieve the same on mobile devices. You may eventually remove the#bodyTable
and#bodyCell
selectors if they are not present in e‑mail source code (Mailchimp usually uses them in its e‑mails). - The last part with
color‑scheme
is there to prevent the email from getting different colors in iOS/macOS Dark mode (for more info, see this thread on StackOverflow and also this article.)
- Click
Save and Close
and you are done!
Tip
To send the same e‑mail you received (for example, the test Mailchimp mail you have sent to yourself), you can move it from Inbox to Drafts in native macOS Mail application by simply dragging it from one folder to another (or hold Alt key while dragging to copy it).