Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To capture an HTML email preview, send the rendered email HTML to a screenshot API that accepts HTML, set the viewport to the width you want to inspect, wait for needed assets to load, and save the returned image. This gives you a repeatable browser-rendered preview without hosting the email publicly. It does not show exactly how Gmail, Outlook, or another email client will render the message.

How the workflow works

  1. Render the template. Generate the final HTML your application intends to send, including its inline styles and any template substitutions. Previewing source templates before their build or rendering step can hide problems introduced by that step.
  2. Send HTML or a preview URL. For a direct HTML capture, submit the HTML string to an endpoint that explicitly supports HTML input. If your email is already shown on a reachable preview route, you can capture that URL instead.
  3. Set the viewport. Capture separate images at the widths relevant to your design. A desktop image cannot tell you whether the layout adapts properly to a narrow screen.
  4. Wait for content and assets. Make sure the capture occurs after any required JavaScript and remote images or fonts are ready. Use the API’s selector or load-wait controls when available.
  5. Save and compare. Store the image alongside the HTML version or commit being reviewed. That makes visual changes easier to trace during QA.
  6. Verify in email clients when fidelity matters. A normal browser screenshot is a fast development preview, not a test of each mail client’s rendering engine.

Choose an input method

Raw HTML

Submitting HTML directly is useful when the template exists only in a build or test environment and does not have a public URL. Cloudflare Browser Run’s screenshot endpoint accepts either html or url; its REST endpoint requires a Browser Rendering edit token, while a Cloudflare Worker can call the binding without an API token. Check the current Cloudflare Browser Run screenshot endpoint documentation for current request fields and authentication details.

A rendered preview URL

Use a URL when you want to capture the actual preview page or wrapper your team reviews. Cloudflare documents URL input and navigation controls. Confirm that the page’s browser state, content, and assets match the version you mean to inspect; a screenshot captures the page served at that URL, not an abstract email template.

Set dimensions and capture timing

Make distinct desktop and mobile captures

Choose dimensions that correspond to the layouts you need to examine. ScreenshotRun’s email-preview guide illustrates 600-pixel desktop and 375-pixel mobile captures; these are vendor examples, not email standards. Cloudflare’s endpoint allows viewport configuration and lists a default viewport of 1920 × 1080, so specify dimensions instead of assuming the default is appropriate.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Wait for the content the image depends on

Cloudflare’s endpoint processes HTML and JavaScript before capture. Its documentation describes navigation wait controls, waitUntil, and waiting for a selector; it warns that a JavaScript-heavy page may be incomplete if captured too early. For raw HTML, check how the chosen API loads referenced assets and make sure image and font URLs are reachable.

Remote assets introduce a separate failure mode: the HTML can render while an image or font does not. Mailpit’s documentation notes that its screenshot feature proxies remote resources and depends on resolving their hosts. Its documented defaults also restrict proxied requests to internal networks and require valid HTTPS certificates for assets. Those Mailpit-specific behaviors should not be assumed for other APIs.

ScreenshotNeo: capture a preview without setting up a browser

ScreenshotNeo is a website screenshot API and MCP server. For an email preview, first expose the rendered email as a reachable preview URL, then request a capture of that URL. The API takes a URL and returns an image or PDF; it does not take the raw email HTML string as the capture input. See the ScreenshotNeo API documentation for request parameters and output options.

For example, this cURL request captures a preview route. Replace the URL with one your capture request can reach:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com/email-preview -o email-preview.webp

For a preview route that requires authentication or access to private data, review the API’s documented authentication and network-access options before using it. Keep API keys in server-side build or QA configuration, not in browser code or committed source.

ScreenshotNeo removes cookie and consent banners, newsletter popups, and chat widgets before capture; each cleanup step can be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and responses include X-Page-Verdict and X-Billed headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents. The Free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 shots. Those plans include every feature.

Sign up for ScreenshotNeo’s free plan to try 1,000 screenshots a month with no card.

Know what the image does—and does not—verify

A screenshot API typically shows a page rendered in a browser engine. ScreenshotRun states that its email previews use headless Chromium and do not simulate Outlook’s Word rendering engine or Gmail’s CSS stripping. A clean desktop or mobile preview can therefore help catch layout and asset problems without establishing how the email will appear in a recipient’s inbox.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use an email-client testing workflow for acceptance checks that require actual client behavior. ScreenshotRun describes dedicated real-client testing services, while Mailpit documents a useful local inbox screenshot feature. Choose a tool based on its current client coverage and whether it supports the automation you need.

Compare the available approaches

Approach Input and output Useful for Important limit
ScreenshotNeo Reachable URL to image or PDF Automated captures of a hosted preview route; cleanup of consent banners, popups, and chat widgets; API or MCP workflows Its documented capture request uses a URL, so first make the rendered email available at a reachable route. A browser screenshot is not an email-client rendering test.
Raw-HTML screenshot API HTML submitted directly; image returned Repeatable development previews without first hosting a page Browser output does not prove actual mail-client behavior. Cloudflare Browser Run and ScreenshotRun document HTML input.
URL screenshot API Reachable URL captured by a browser Capturing an existing staging or preview route The captured page and browser state need to match the intended preview.
Email inbox or client testing tool Email rendered or viewed through email-specific tooling Local message inspection or final compatibility verification, depending on the tool Capabilities differ. Mailpit documents a web UI screenshot, not API automation.

When evaluating a provider, check whether it accepts raw HTML, which viewport and readiness controls it exposes, how it fetches remote assets, whether captures can be automated, which browser or mail clients perform rendering, and how it handles your HTML and credentials.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Mailpit’s screenshot feature: useful for local inspection, not an automated API

Mailpit documents HTML screenshot generation in its web UI; its documentation says the feature cannot be automated through an API. It proxies remote images and fonts, and its handling of Outlook-specific markup such as <o:p> may rewrite or remove those tags, affecting line spacing. Account for those limitations if you use Mailpit to inspect a local test message.

Troubleshoot missing or misleading previews

  • The request rejects the HTML field: The endpoint may accept only URLs, or may require a different field or content type. Confirm the provider’s current input schema; do not assume every screenshot endpoint accepts raw HTML.
  • The capture is blank or only partly rendered: The page may still be executing JavaScript or waiting on a selector. Configure the documented navigation or readiness controls, and verify the preview route can load independently.
  • Images or fonts are missing: Check that asset URLs are reachable from the capture service, use valid HTTPS where required, and are not blocked by network restrictions or authentication. A browser capture cannot load an asset it cannot access.
  • The mobile layout looks like desktop: Confirm that the request sets the intended viewport width. Render separate captures for the layouts you need to inspect.
  • The screenshot differs from an inbox: The image may be a Chromium rendering rather than a target email-client rendering. Use an email-client testing tool for client-specific acceptance checks.
  • A Mailpit screenshot changes line spacing: Inspect Outlook-specific markup, including <o:p>; Mailpit documents that such tags may be altered or removed.
  • REST authentication fails on Cloudflare: Cloudflare documents a Browser Rendering edit token for REST use. Its Workers binding is a separate route documented as not requiring an API token; follow the applicable path’s current instructions.

Operational notes for repeatable QA

  • Capture the HTML produced by the same template-rendering step used for the intended output.
  • Record the viewport and relevant wait conditions with each capture so comparisons use like-for-like settings.
  • Keep the source HTML or revision identifier beside the saved screenshot; this is a workflow practice, not an automatic feature of the APIs.
  • Protect credentials and avoid sending confidential message content to a provider unless its data handling is appropriate for your use case.
  • Use browser screenshots for fast visual iteration and a separate client-rendering check where inbox compatibility is the requirement.

Frequently Asked Questions

Can I preview an HTML email without hosting it?

Yes, if the screenshot endpoint accepts raw HTML. Cloudflare Browser Run and ScreenshotRun document HTML input; a URL-only capture service requires a reachable preview page.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Does a browser screenshot guarantee the email will look the same in Gmail or Outlook?

No. It shows a browser rendering, not necessarily the rendering engine or CSS handling used by those clients.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.