MyMail.Blazor (2.1.12)
Installation
dotnet nuget add source --name RAAPEREIRA --username your_username --password your_token dotnet add package --source RAAPEREIRA --version 2.1.12 MyMail.BlazorAbout this package
Blazor email client UI components built on MyMail and SmarterMail.Net.
MyMail.Blazor
An embeddable Blazor email client built on MyMail and SmarterMail.Net. Targets .NET 10 and includes its own styles without requiring a third-party component library.
Installation
Install the package from your configured NuGet feed:
dotnet add package MyMail.Blazor
Configuration
Register both the headless library and the Blazor services in Program.cs:
using MyMail.Extensions;
using MyMail.Blazor.Extensions;
services.AddMyMail(options =>
{
options.BaseUrl = "https://mail.example.com";
options.AllowedEmailDomains = new[] { "example.com" }; // Optional
});
services.AddMyMailBlazor();
Add the stylesheet to your host page:
<link href="_content/MyMail.Blazor/mymail.css" rel="stylesheet" />
Import the component namespace in _Imports.razor:
@using MyMail.Blazor.Components.Mail
Render the mail client with credentials supplied by your application:
<MailClient @key="username" Username="@username" Password="@password" />
The host application owns authentication. Use @key to remount the component
when switching users. AddMyMailBlazor() does not register AddMyMail();
both registrations are required.
Inline images and Content-Security-Policy
Message bodies render in a sandboxed srcdoc iframe. Inline images are
embedded as data: URIs by MyMail (SmarterMail's /attachment/inline URLs
need authentication and fail with 401 Missing auth in an iframe). If your host
application sends a Content-Security-Policy, allow data: images, for example
img-src 'self' data: https:. Without it, inline images in received messages
do not display.