To capture an HTML email preview, send the rendered email HTML to a screenshot API that accepts HTML, choose a viewport width, wait for required assets to load, and save the returned image. This lets you inspect a browser-rendered version without hosting the email publicly. It does not show how Gmail, Outlook, or another mail client will render the message.
Render the exact email HTML you want to inspect
Start with the output of your template engine or build step—not just the template source. The rendered HTML is what the browser needs to display and what you need to review for the current revision. Remove test-only data or replace it with realistic content if text length, personalization, or image selection affects layout.
A screenshot API that accepts raw HTML lets you preview that output without first publishing it at a public URL. For example, both Cloudflare Browser Run and ScreenshotRun document HTML input. If your team already has a reachable preview route, a URL-based capture is also an option; use the route and browser state that match what you intend to inspect.
Choose a screenshot method for the job
| Approach | Input and output | Best fit | Limitation |
|---|---|---|---|
| ScreenshotNeo | One GET request with a URL returns an image or PDF; it is a website screenshot API, so provide a reachable page that renders the email preview. | Automated page captures when the email is available at a preview URL. | It is not a raw-email-client renderer. The captured page is a browser view, not proof of Gmail or Outlook fidelity. See ScreenshotNeo. |
| Raw-HTML screenshot API | Submit the HTML string and receive an image. Cloudflare Browser Run and ScreenshotRun document HTML input. | Repeatable previews of generated HTML without hosting it first. | The result is browser-rendered; it does not establish actual mail-client behavior. |
| URL screenshot API | Submit a reachable preview URL and capture the resulting page. | A staging route or preview wrapper already exists. | The page, viewport, and browser state must match the view you want to inspect. |
| Email inbox or client tool | Inspect a delivered or locally captured message through email-specific tooling. | Local message review or verification in target clients, depending on the tool. | Features vary. Mailpit documents a web UI screenshot, not screenshot automation through its API. |
Mailpit’s screenshot feature is useful for inspecting messages in its web UI, but its documentation says screenshot generation cannot be automated via its API. It proxies remote images and fonts, so their hosts must resolve; its documented defaults also restrict requests to internal networks and require valid HTTPS certificates for assets. Mailpit notes that Outlook-specific markup such as <o:p> may be rewritten or removed, affecting line spacing. See its HTML screenshot documentation.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstall#1 Best Overall
Capture raw HTML through an API
Use the provider’s current endpoint and authentication requirements. Cloudflare Browser Run’s REST screenshot endpoint accepts either a URL or HTML input and requires a Browser Rendering edit token. Cloudflare Workers can use the documented binding without an API token. Its documentation describes rendering HTML and JavaScript before capture, with viewport, clipping, full-page, navigation-wait, and selector-wait controls; the documented default viewport is 1920×1080. These details apply to Cloudflare’s API and may change.
For Cloudflare’s REST API, put your email HTML in the documented html input and configure the viewport and authentication according to the current endpoint documentation. Keep the token server-side—in a CI secret store or backend environment variable—not in browser-side code or a public repository. Do not assume every screenshot provider uses the same parameter names, request body, or output format.
If using a different raw-HTML API, follow its docs for the request field containing the HTML, authentication, output encoding, and maximum input size. Avoid embedding secrets in the message markup. The HTML may contain customer data, so check the provider’s data-handling terms and your organization’s policy before sending it.
Rank #2
Set viewport widths for desktop and mobile
Viewport dimensions determine which responsive layout you see. Generate separate captures for the screen widths your team wants to review rather than assuming a single desktop image represents mobile behavior. ScreenshotRun illustrates 600-pixel desktop and 375-pixel mobile captures; those are its examples, not email standards. Cloudflare Browser Run supports configurable viewport dimensions.
- Capture at the desktop width your design or QA process targets.
- Capture a separate narrow viewport to inspect responsive behavior, wrapping, and overflow.
- Use the same dimensions between template revisions so visual comparisons are meaningful.
- Check whether the API captures the full page or only the viewport; set clipping or full-page behavior deliberately.
Wait for content and remote assets
A screenshot is only as complete as the page at capture time. A remote image or web font that has not loaded can change spacing or leave an empty area. For URL captures and JavaScript-generated content, use the provider’s readiness controls where available: navigation wait conditions, a selector that appears when the preview is ready, or an appropriate delay. Cloudflare documents waitUntil and waitForSelector controls and warns that JavaScript-heavy pages may be incomplete if captured too early.
For direct HTML input, check how the API loads referenced assets and whether it can reach their hosts. Confirm image and font URLs are accessible to the service; a URL that works only inside your laptop, VPN, or private network may fail from a hosted renderer. Mailpit’s documentation illustrates why this matters: its screenshot path proxies remote resources and depends on host resolution, with restrictions on internal addresses and certificate validity.
Save, compare, and trace each preview
Save the returned image as a build or QA artifact. Keep the corresponding rendered HTML, template revision or commit, viewport dimensions, and capture time with it. That makes a visual difference traceable to the exact input instead of leaving an image with no reproducible source. Compare desktop and mobile captures separately, and review changed regions rather than treating a pixel difference as proof of a user-visible defect.
Know what a browser screenshot can and cannot prove
A screenshot API renders HTML in a browser engine, not inside every recipient’s email client. ScreenshotRun says its headless Chromium preview does not simulate Outlook’s Word rendering engine or Gmail’s CSS stripping. Therefore, use API captures for fast iteration on structure, responsive behavior, and obvious visual regressions; use an email-specific real-client testing pass when compatibility with particular clients is an acceptance requirement. Verify the chosen testing service’s current client coverage.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Or skip the browser setup
ScreenshotNeo is a website screenshot API, so publish or otherwise make a preview page reachable, then capture it with one GET request. It does not accept an HTML string as the screenshot input. The example below captures the preview page as WebP; see the ScreenshotNeo documentation for API details.
Rank #4
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
ScreenshotNeo removes cookie/consent banners, newsletter popups, and chat widgets before capture; each cleanup step can be turned off. Bot checks/CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, with response headers identifying the page verdict and billing status. Its MCP server provides screenshot tools for AI agents, and the free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots.
Sign up for 1,000 free screenshots a month with no card.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Troubleshoot common preview problems
The API rejects the request
Check the provider’s required authentication, endpoint, input field, and content limits. For Cloudflare Browser Run REST requests, the docs specify a Browser Rendering edit token; a Workers binding uses a different authentication path. Do not reuse credentials or request formats from another provider.
Recommended Free Tools
The screenshot is blank or missing part of the email
Check that the correct rendered HTML was sent and that the endpoint accepts HTML input. If content is produced by JavaScript, wait for the relevant selector or rendering condition. If the email references remote images or fonts, verify that the rendering service can reach those hosts and that its resource restrictions permit the requests.
Mobile layout looks like desktop
Confirm that the request actually sets a narrow viewport and that the capture is not using a provider default. Capture a separate image at the intended mobile width; a desktop capture resized afterward does not test responsive layout.
Text spacing differs from the expected Outlook message
A generic browser screenshot does not reproduce Outlook’s Word engine. Outlook-specific markup may also be altered by intermediary tools; Mailpit specifically notes possible changes to <o:p>. Use a real-client verification workflow when Outlook fidelity is required.
Remote assets fail only in the screenshot service
Check DNS resolution, HTTPS certificate validity, and whether the asset host is private or otherwise blocked. Mailpit’s documented defaults restrict proxied requests to internal networks and require valid HTTPS certificates; other providers may have different rules, so check their current documentation.
FAQ
Can I screenshot an HTML email without hosting it?
Yes, if the screenshot API accepts raw HTML. Cloudflare Browser Run and ScreenshotRun document that input mode. A URL-only service instead needs a reachable page to capture.
Does a 375-pixel capture guarantee how an email looks on a phone?
No. It shows the browser rendering at that viewport width, not the exact rendering or interface of a mobile email client.
Can I automate Mailpit screenshots through its API?
Mailpit documents screenshot generation in its web UI, not as an API feature. Use a service with documented screenshot automation for a repeatable API workflow.
Quick Recap
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.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →




