CoreMailer 1.1.3
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package CoreMailer --version 1.1.3
NuGet\Install-Package CoreMailer -Version 1.1.3
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.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CoreMailer --version 1.1.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: CoreMailer, 1.1.3"
#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.3
// Install CoreMailer as a Cake Tool
#tool nuget:?package=CoreMailer&version=1.1.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
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 | Versions 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.
-
.NETCoreApp 2.0
- Microsoft.AspNetCore.Mvc.Abstractions (>= 2.0.0)
- Microsoft.AspNetCore.Mvc.Core (>= 2.0.0)
- Microsoft.AspNetCore.Mvc.Razor (>= 2.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.