October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
Base64

How to Send Base64 Screenshot Images by Email from Web Pages

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

Use the canvas export as the email payload. Call canvas.toDataURL("image/png") after the screenshot is ready, then either pass that data URL to an attachment field or place it in the HTML body as <img src="...">. Attachments arrive as downloadable MIME parts; inline images appear in the message itself. The right path depends on your email service, target mail clients, image size and security model.

Choose the email result first

Result How it works Best use Main caveat
File attachment The image is sent as a MIME attachment with a filename and content type. Recipients must download, archive or forward the original image. Your provider or service may require a particular Base64 format and attachment configuration.
Inline HTML image The message body contains <img src="data:image/png;base64,...">. A report or notification where the screenshot should be visible immediately. Rendering of data URLs varies by mail client; test the clients your recipients use.

These are separate delivery modes. An attachment does not become an inline image merely because its bytes are Base64 encoded, and an inline data URL is not a substitute for a properly configured MIME part.

Export the rendered canvas

Export only after drawing has completed. The browser’s HTMLCanvasElement.toDataURL() method returns a data URL containing the image bytes. PNG is the default format and is required in browsers; if a requested format is unsupported, the browser falls back to PNG.

const dataUrl = canvas.toDataURL("image/png");

// Example: inspect the result before sending
console.log(dataUrl.slice(0, 32));
// data:image/png;base64,...

You can request JPEG or WebP when your browser and workflow support them:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Logitech Brio 101 Full HD 1080p Webcam for Streaming and Meetings - Black
  • Compatible with Nintendo Switch 2’s new GameChat mode
  • Auto-Light Balance: RightLight boosts brightness by up to 50%, reducing shadows so you look your best—compared to previous-generation Logitech webcams (1)
  • Privacy with a Slide: The integrated webcam cover makes it easy to get total, reliable privacy when you're not on a video call
  • Built-In Mic: The built-in microphone lets others hear you clearly during video calls
  • Easy Plug-And-Play: The Brio 101 works with most video calling platforms, including Microsoft Teams, Zoom and Google Meet—no hassle; it just works
const jpegUrl = canvas.toDataURL("image/jpeg", 0.85);
const webpUrl = canvas.toDataURL("image/webp", 0.85);

The returned value includes a media-type prefix followed by Base64 data. Keep that prefix when the receiving interface accepts a complete data URL. If an API explicitly requests raw Base64, split at the first comma and send the media type separately:

function splitDataUrl(dataUrl) {
  const comma = dataUrl.indexOf(",");
  if (comma < 0) throw new Error("Not a valid data URL");
  const header = dataUrl.slice(0, comma);      // data:image/png;base64
  const payload = dataUrl.slice(comma + 1);   // Base64 only
  const mime = header.slice(5).split(";")[0];
  return { mime, payload };
}

Do not remove the prefix unless your email interface documents that requirement.

Attach the screenshot with an email service

An email provider must turn your value into a MIME part. EmailJS documents a canvas example: pass the data URL as the content of a template attachment variable, then configure that variable’s filename and content type in the template. The exact template identifiers and recipient handling belong to your EmailJS account, so the following is an integration pattern rather than a drop-in credential configuration.

const canvas = document.querySelector("#shot");
const dataUrl = canvas.toDataURL("image/png");

const templateParams = {
  to_email: recipient,
  attachment_content: dataUrl,
  attachment_name: "web-page-screenshot.png"
};

emailjs.send("YOUR_SERVICE_ID", "YOUR_TEMPLATE_ID", templateParams)
  .then(() => {
    statusElement.textContent = "Screenshot sent";
  })
  .catch((error) => {
    console.error(error);
    statusElement.textContent = "The screenshot could not be sent";
  });

Configure the template’s attachment variable to consume Base64/data-URL content, set the filename to end in .png, and set the content type to image/png. If your service expects raw Base64, use splitDataUrl() and provide image/png as metadata.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Sale
Logitech C270 720p Webcam Plug-and-Play Wide Screen Video Calling - Black
  • Compatible with Nintendo Switch 2’s new GameChat mode
  • Crisp HD 720p/30 fps video calls with diagonal 55° field of view and auto light correction. Compatible with popular platforms including Skype and Zoom.
  • The built-in noise-reducing mic makes sure your voice comes across clearly up to 1.5 meters away, even if you’re in busy surroundings.
  • C270’s RightLight 2 feature adjusts to lighting conditions, producing brighter, contrasted images to help you look good in all your conference calls.
  • The adjustable universal clip lets you attach the camera securely to your screen or laptop, or fold the clip and set the webcam on a shelf. You’re always ready for your next video call.

Protect the sending path

  • Never put SMTP passwords, private API keys or privileged mail credentials in public browser JavaScript.
  • Validate the recipient and message fields, rate-limit sends and add abuse controls.
  • For a controlled server endpoint, upload the image and let the server call the mail provider. This adds validation and keeps secrets off the page.
  • If browser-direct delivery is acceptable, use the provider’s documented public-key model and restrict the template so it cannot be abused as an open relay.

The appropriate architecture depends on the provider and your threat model; no single browser-only pattern is universally safe.

Show it inline in an HTML email

An inline data URL places the screenshot in the HTML body:

const dataUrl = canvas.toDataURL("image/png");
const html = `
  <p>Your captured page:</p>
  <img src="${dataUrl}" alt="Screenshot of the captured web page">
`;

Pass that HTML to an email API’s HTML-body field. Microsoft Power Automate documents this Base64 data-URL pattern for an HTML <img>. It demonstrates the syntax, not universal support: some clients block or rewrite data URLs. For important messages, provide an attachment or a hosted-image fallback and test Gmail, Outlook, Apple Mail and any enterprise clients you must support.

Escape surrounding HTML safely

The generated data URL itself contains Base64 characters, but values such as a user-supplied alt string still need HTML escaping. Do not concatenate untrusted text into the body without sanitizing it. Restrict the image source to the data URL you generated and set a meaningful alternative description.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
NexiGo N60 1080P Webcam with Microphone, Software Control & Privacy Cover, USB HD Computer Web Camera, Plug and Play, for Zoom/Skype/Teams, Conferencing and Video Calling
  • 【Full HD 1080P Webcam】Powered by a 1080p FHD two-MP CMOS, the NexiGo N60 Webcam produces exceptionally sharp and clear videos at resolutions up to 1920 x 1080 with 30fps. The 3.6mm glass lens provides a crisp image at fixed distances and is optimized between 19.6 inches to 13 feet, making it ideal for almost any indoor use.
  • 【Wide Compatibility】Works with USB 2.0/3.0, no additional drivers required. Ready to use in approximately one minute or less on any compatible device. Compatible with Mac OS X 10.7 and higher / Windows 7, 8, 10 & 11 / Android 4.0 or higher / Linux 2.6.24 / Chrome OS 29.0.1547 / Ubuntu Version 10.04 or above. Not compatible with XBOX/PS4/PS5.
  • 【Built-in Noise-Cancelling Microphone】The built-in noise-canceling microphone reduces ambient noise to enhance the sound quality of your video. Great for Zoom / Facetime / Video Calling / OBS / Twitch / Facebook / YouTube / Conferencing / Gaming / Streaming / Recording / Online School.
  • 【USB Webcam with Privacy Protection Cover】The privacy cover blocks the lens when the webcam is not in use. It's perfect to help provide security and peace of mind to anyone, from individuals to large companies. 【Note:】Please contact our support for firmware update if you have noticed any audio delays.
  • 【Wide Compatibility】Works with USB 2.0/3.0, no additional drivers required. Ready to use in approximately one minute or less on any compatible device. Compatible with Mac OS X 10.7 and higher / Windows 7, 10 & 11, Pro / Android 4.0 or higher / Linux 2.6.24 / Chrome OS 29.0.1547 / Ubuntu Version 10.04 or above. Not compatible with XBOX/PS4/PS5.

Use toBlob() for larger captures

toDataURL() builds the complete image as an in-memory string. Large canvases therefore consume memory and can hit length limits when the string is placed in URLs or other constrained fields. MDN recommends considering toBlob() for larger images. It gives you a binary Blob, which can be uploaded with FormData or converted to Base64 only at the boundary that requires it.

canvas.toBlob(async (blob) => {
  if (!blob) throw new Error("Canvas export failed");

  const form = new FormData();
  form.append("screenshot", blob, "web-page-screenshot.png");
  form.append("to", recipient);

  const response = await fetch("/send-screenshot", {
    method: "POST",
    body: form
  });
  if (!response.ok) throw new Error(`Send failed: ${response.status}`);
}, "image/png");

This binary route avoids an unnecessary Base64 expansion during transport. The available browser and email documentation does not establish one universal attachment-size limit, so measure the encoded request and check the limits of your chosen provider instead of relying on a generic number.

Make a cross-origin canvas exportable

A canvas becomes tainted when it contains pixels loaded from another origin without an appropriate CORS response. Exporting a non-origin-clean canvas raises a SecurityError. Client-side code cannot bypass this restriction.

  1. Serve the source image with an Access-Control-Allow-Origin response that permits your page’s origin (or the narrowly required origin).
  2. Set the image element’s crossOrigin property before assigning src.
  3. Wait for the image to load, then draw it and export.
const image = new Image();
image.crossOrigin = "anonymous";
image.onload = () => {
  const canvas = document.querySelector("#shot");
  canvas.width = image.naturalWidth;
  canvas.height = image.naturalHeight;
  canvas.getContext("2d").drawImage(image, 0, 0);

  try {
    const dataUrl = canvas.toDataURL("image/png");
    sendAttachment(dataUrl);
  } catch (error) {
    if (error.name === "SecurityError") {
      showError("The source image is cross-origin and does not permit canvas export.");
    } else {
      throw error;
    }
  }
};
image.onerror = () => showError("The source image could not be loaded");
image.src = "https://images.example.com/page-image.png";

If you do not control the image host, use a server-side fetch under your control (subject to that site’s policies), capture the page through a service, or send the original URL instead. Do not promise users that a proxy or JavaScript flag will defeat browser security.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
EMEET C960 1080P Webcam with Microphone, 2 Mics, 90° FOV, Computer Camera
  • 1080P Webcam with Cover for Video Calls - EMEET computer webcam provides design and Optimization for professional video streaming. Realistic 1920 x 1080p video, 5-layer anti-glare lens, providing smooth video. C960 computer camera delivers 1920x1080 video with fixed focus (11.8–118.1 inches), so as to provide a clearer image. C960 USB webcam has a cover and can be removed automatically to meet your needs for privacy. For optimal image performance, use the webcam in a well-lit environment.
  • Built-in 2 Omnidirectional Mics - EMEET webcam with microphone for desktop features 2 built-in omnidirectional microphones, picking up your voice to create clear audio for communication. When installing the webcam, select EMEET C960 as the default microphone input device in your computer and video applications and select C960 as the default device in Zoom/Teams and ensure microphone permissions are enabled for proper use. Please note that C960 does not include built-in speakers.
  • Automatic Light Adjustment - Automatic exposure adjustment is applied in EMEET HD webcam 1080p so that the streaming webcam can deliver stable image performance. EMEET C960 camera for computer also features color adjustment and exposure optimization to help you look your best. For optimal video quality, it is recommended to use the webcam in normal or well-lit environments and select suitable video settings in your application. Proper lighting helps achieve a clearer and more balanced image.
  • Plug-and-Play & Upgraded USB Connectivity - New C960 webcam features both USB Type-A & A-to-C adapter connections for wider compatibility. For stable performance, connect the webcam directly to the computer's main USB port and ensure the device is recognized correctly. If a hub or docking station is used, please ensure it provides sufficient power and stable data transmission, as limited ports may affect performance. 90° wide-angle lens captures more participants without frequent adjustments.
  • High Compatibility & Multi Application - C960 webcam for laptop is compatible with Windows 10/11, macOS 10.14+, and Android TV 7.0+. Not supported: Windows Hello, TVs, tablets, or game consoles. It works with Zoom, Teams, Facetime, Google Meet, YouTube and more. Please select C960 webcam as the default camera and microphone device in your application and ensure camera/microphone permissions are enabled, especially on macOS. (Tips: Incompatible with Windows Hello)

Complete browser workflow

  1. Render the page or screenshot into a canvas.
  2. Wait for fonts, images and any asynchronous drawing to finish.
  3. Check that every cross-origin source was loaded with valid CORS headers.
  4. Export with toDataURL() for a small, simple integration or toBlob() for a larger binary upload.
  5. Choose attachment or inline HTML deliberately.
  6. Send through a configured provider, with server-side controls where credentials or abuse risk require them.
  7. Display a success or failure state and retain a fallback such as a download link.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

ScreenshotNeo captures a URL through one request, returning PNG, JPEG, WebP or PDF. It accepts cookie and consent banners before capture and removes more than 60 known consent platforms, newsletter popups and chat widgets; each cleanup step can be disabled. Bot checks, blank pages, timeouts, failed loads and cache hits are not billed, and the response identifies the result with X-Page-Verdict and X-Billed headers. You can then attach the returned bytes or upload them to your mail provider.

curl -G "https://api.screenshotneo.com/v1/shot" 
  -d access_key=YOUR_API_KEY 
  --data-urlencode url=https://stripe.com 
  -o shot.webp

Python:

import requests

r = requests.get(
    "https://api.screenshotneo.com/v1/shot",
    params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"},
    timeout=90,
)
r.raise_for_status()
open("shot.webp", "wb").write(r.content)

Node.js:

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`Screenshot failed: ${res.status}`);
const bytes = Buffer.from(await res.arrayBuffer());

See the ScreenshotNeo documentation for request options. It also provides an MCP server with take_screenshot, get_page_info and capture_pdf for Claude, Cursor and other MCP clients. Features include full-page lazy-image loading, CSS-selector element capture, device presets, custom CSS and JavaScript, waits, request blocking, cookies and headers, geolocation, caching, signed links, webhooks, bulk capture and a usage API.

Every plan includes the features. The Free plan provides 1,000 screenshots per month without a card; paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account to try the capture-and-email workflow.

Troubleshooting

SecurityError during export

The canvas is tainted by a cross-origin image or video. Configure CORS on the source before drawing, or move acquisition to a controlled server. Catch the exception so the user receives a useful fallback.

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

The attachment arrives as text

Your template probably treated the data URL as an ordinary variable. Configure a variable attachment with a filename and image content type, or convert to raw Base64 only when the provider requires it.

The message is delivered without an inline image

The recipient’s client may block data URLs, the provider may sanitize the HTML, or the body may have been sent as plain text. Send a correctly marked HTML body and retain an attachment or hosted-image fallback.

The browser freezes while exporting

The canvas is too large for an efficient data-string conversion. Resize before export, use toBlob(), and upload binary data instead of embedding a very large string in a request.

The image is blank or incomplete

Export happened before drawing, fonts or lazy images finished. Wait for the relevant load events or application state, verify canvas dimensions, and export only after the final render.

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

The email request exposes a secret

Remove provider credentials from frontend code. Route the send through a protected endpoint or use the provider’s documented restricted browser integration with rate limits and validation.

Attachment versus inline: a practical decision

  • Choose an attachment when fidelity, downloading and long-term filing matter.
  • Choose an inline image when immediate visual context matters and your recipient clients are tested.
  • Offer both when the screenshot is important: inline for convenience, attachment for reliable access.
  • Use Blob/binary transfer as the transport for large images, even if your final provider requires Base64 at its API boundary.

Frequently Asked Questions

Does Base64 itself make an image an email attachment?

No. Base64 is an encoding. The email service must create a MIME attachment part and assign its filename and content type.

Can I export a canvas containing an image from another website?

Only when that image is served with compatible CORS headers and loaded with the correct cross-origin setting; otherwise the browser blocks export.

Is an inline data URL guaranteed to display in every mail app?

No. Validate the target clients and provide an attachment or hosted-image fallback.

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

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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.

Read next

Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.