CoreMailer 1.1.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package CoreMailer --version 1.1.2
NuGet\Install-Package CoreMailer -Version 1.1.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CoreMailer" Version="1.1.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CoreMailer --version 1.1.2
#r "nuget: CoreMailer, 1.1.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install CoreMailer as a Cake Addin
#addin nuget:?package=CoreMailer&version=1.1.2

// Install CoreMailer as a Cake Tool
#tool nuget:?package=CoreMailer&version=1.1.2

CoreMailer

Send email from .NET Core 2.0 with razor template Check the exmple code for details 😃 happy coding

How to Use:

To Install

npm install CoreMailer -Version 1.0.0

In Startup.cs add

services.AddScoped<ITemplateRenderer, TemplateRenderer>();
services.AddScoped<ICoreMvcMailer, CoreMvcMailer>();

Create cshtml template under any views folder e.g.

Views/Emails/Registration.cshtml

The content of cshtml can be

@model UserInfo
Hello <strong>@Model.UserName</strong> you are <strong>Awxam</strong>

NOTE: For emails you have to use inline styling.

in the controller use following:

Constructor

private readonly ICoreMvcMailer _mailer;
public HomeController(ICoreMvcMailer mailer)
{
  _mailer = mailer;
}

ActionMethod

public IActionResult About()
    {
        MailerModel mdl = new MailerModel("YourHostName",1234)
        {
            FromAddress = "Your Address",
            IsHtml = true,
            User = "YourUserName",
            Key ="YourKey",
            ViewFile = "Emails/Register",
            Subject = "Registration",
            Model = new // Your actual class model
            {
            }
        };
        
        _mailer.Send(mdl);
        return View();
    }
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 is compatible.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
3.0.0 801 2/17/2021
2.1.0 1,876 4/7/2020
2.0.0 1,689 1/23/2020
1.1.4 3,556 1/4/2018
1.1.3 1,216 12/25/2017
1.1.2 1,144 10/13/2017
1.1.1 1,109 10/13/2017
1.1.0 1,184 10/13/2017
1.0.0 1,208 10/12/2017