Blazor (Wasm) - How to Send Email from a PWA

Blazor (Wasm) - How to Send Email from a PWA

In this tutorial, you'll learn how to send Email from a PWA with Blazor (Wasm).

Recently, I was tasked with developing a simple Xamarin mobile application to collect user form inputs, perform calculations on that input, and generate output that could be emailed. Our client was on a budget and, with such basic requirements, jumping through all the app store hoops seemed like overkill for this project. I decided to do a proof-of-concept using a Blazor (Wasm) Progressive Web App (PWA). One risk area I identified for this architecture was the send email requirement.

Normally, I prefer to implement pre-existing email components that have some level of built-in template support, such as FluentEmail. If you have serious email needs, be sure to check out Tim Corey’s Sending Email in C## using FluentEmail video.

It will help you get up and running quickly. That approach, unfortunately, would not work for my requirements given the client-side nature of Blazor WebAssembly. The reason is that a Blazor PWA is sandboxed to its browser platform such that sending email is not supported. Attempting to use classes such as SmtpClient should result in a compiler warning/error and, if ignored, will result in a System.PlatformNotSupportedException as described in this SO question: ‘Blazor Wasm sending mail throw exception‘. So, how did I get around this limitation?

blazor wasm xamarin pwa

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Xamarin Forms Training Institute | Xamarin Forms Development Classes | Xamarin Training

Xamarin Training course is primarily designed for Beginner(s)/Professional(s) who want to learn how to develop native cross-platform apps with C# that run-on Android, iOS and Windows.

Select List in Blazor || DropDown List in Blazor

LIKE | COMMENT | SHARE | SUBSCRIBE In this Blazor Tutorial, I will show you how to use #DropDownList in blazor app using MatBlazor - (Material Design compone...

Blazor : Calling REST API ASP NET Core Blazor | WEB API

LIKE | COMMENT | SHARE | SUBSCRIBE How to call and consume a REST API from ASP.NET Core Blazor application. Blog : https://aspdotnetexplorer.blogspot.com/sea...

Call POST API ASP NET Core Blazor | Blazor CRUD using API Part-1

LIKE | COMMENT | SHARE | SUBSCRIBE In this tutorial, I will show you how to save data into database using Web API form Asp.Net Core Blazor #Webassembly appli...

Call GET API ASP NET Core Blazor | Blazor CRUD using API Part-2

LIKE | COMMENT | SHARE | SUBSCRIBE In this tutorial, I will show you how to get all data from database using Web API form Asp.Net Core Blazor #Webassembly ap...