Embed images for email

    Create an unsent email message whose local raster images travel with its HTML. The host retains responsibility for recipients, delivery, disposal and application-specific mail policy.

    This uses the same bounded local-image authorization as the editor image workflow.

    Actual embedded image selected within the Avalonia HTML document.
    Actual embedded image selected within the Avalonia HTML document.

    Use it in your application

    Set the trusted local base folder and enable the intended local-resource selection policy before loading a document that refers to local files.

    Await email export after editing. A pending Source draft is applied before the message is built, and unsupported or unauthorized local image references are reported.

    The returned MailMessage is owned by your application. Set its envelope fields and pass it to your chosen delivery service only after your normal send checks. Dispose it after use.

    using var message = await editor.Content.GetEmailMessageWithLocalImagesEmbeddedAsync();
    message.Subject = "Account update";
    // Set recipients and deliver through your application's approved mail workflow.

    Continue with

    Last updated on Oct 18, 2026

    Put this into practice.

    Start with the C# Avalonia sample. Restore this edition's package and install the native browser prerequisites before running it.

    Prefer a guided look? Book a free live demo with our engineers - live on Zoom or Teams, never a chatbot.