SendEmail_Ltnm 1.0.3
See the version list below for details.
dotnet add package SendEmail_Ltnm --version 1.0.3
NuGet\Install-Package SendEmail_Ltnm -Version 1.0.3
<PackageReference Include="SendEmail_Ltnm" Version="1.0.3" />
paket add SendEmail_Ltnm --version 1.0.3
#r "nuget: SendEmail_Ltnm, 1.0.3"
// Install SendEmail_Ltnm as a Cake Addin #addin nuget:?package=SendEmail_Ltnm&version=1.0.3 // Install SendEmail_Ltnm as a Cake Tool #tool nuget:?package=SendEmail_Ltnm&version=1.0.3
1.0.3 Fix bug attachment
Send Mail Sample Support Only dotnet Core Config Step By Step. Step one: Add config to file "appsettings.json": "Email": { "Smtp": { "Host": "host_mail", "Port": 25, "Username": "user_mail", "Password": "password_user_mail", "DefaultCredentials": false }, "EnableSsl": false, "BodyIsHtml": true },
Step two add middleware to ConfigureServices: services.Configure<EmailSetting>(Configuration.GetSection("Email")); services.AddScoped<IEmailService, EmailService>();
Step three add services and use:
Method: SendEmail(string template, string layout, string subject, Dictionary<string, string> mergedFields, List<string> toReceipients, List<string> bccToReceipients = null, List<string> ccToReceipients = null, Dictionary<string, byte[]> attachments = null, int? createdId = null, List<int> receiverIds = null, string displayName = null)
NOTE: parameter "layout" required has text "[[Content]]", "mergedFields" is list key and value mapping to template has text "[[key]]" and "[[key]]" will replace equal value
Example:
public class HomeController : Controller { private IEmailService _mailSvc;
public HomeController(IEmailService mailSvc)
{
_mailSvc = mailSvc;
}
[HttpGet("sendmail")]
public IActionResult Senmail()
{
Dictionary<string, string> fiels = new Dictionary<string, string>();
fiels.Add("item", "luantran");
return Ok(_mailSvc.SendMail("ACB [[item]]", "Layout SendMail [[Content]] end layout", "Test Send mail" , fiels, new List<string> { "abc@acb.vn" }));
}
}
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.2 is compatible. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
-
.NETCoreApp 2.2
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.