MailService.NET
1.0.0
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 MailService.NET --version 1.0.0
NuGet\Install-Package MailService.NET -Version 1.0.0
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="MailService.NET" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MailService.NET --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: MailService.NET, 1.0.0"
#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 MailService.NET as a Cake Addin #addin nuget:?package=MailService.NET&version=1.0.0 // Install MailService.NET as a Cake Tool #tool nuget:?package=MailService.NET&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
MailService
NuGetPackage For Send Mail
What is Mail Service
This nugget package can be used to send mail in the Console App, WinForm App, Web App, Web API and other kind of applications using the C # language. This NuGet package also supports .Net Framework and .Net Core. This NuGet package supports sending both messages and Html pages via email. Good luck in using NuGet Package.
- ✨Note
- This NuGet Package can be used with SMTP.
Use Package
ASP.Net Core and ASP.NET
- Startup.cs
services.AddMailService(new MailSetting { Host = "host", Password = "password", Port = port, SenderMail = "mail" });
Standart Message
public class WeatherForecastController : ControllerBase { private IMailService MailService { get; set; } public WeatherForecastController(IMailService mailService) { MailService = mailService; } [HttpGet] public IActionResult Get() { var model = MailService.SendMessage(new MailServiceForGmail.DTO.ClientMailInfoDTO() { Body = "body", DisplayName = "displayName", EnableSSL = false, Subject = "subject", UseDefaultCredentials = true, ToMails = new List<MailServiceForGmail.DTO.ToAndCCMailDTO>() { new MailServiceForGmail.DTO.ToAndCCMailDTO() { MailAddress = "toMail",DisplayName = "displayName" } }, Priority = System.Net.Mail.MailPriority.High, UseCertificate = true }); } }
* Html Message
```sh
public class WeatherForecastController : ControllerBase
{
private IMailService MailService { get; set; }
public WeatherForecastController(IMailService mailService)
{
MailService = mailService;
}
[HttpGet]
public IActionResult Get()
{
var model = MailService.SendMessageWithHtml(
new MailServiceForGmail.DTO.ClientMailInfoWithHtmlDTO()
{
DisplayName = "displayName",
EnableSSL = true,
Subject = "subject",
UseDefaultCredentials = true,
ToMails = new List<MailServiceForGmail.DTO.ToAndCCMailDTO>()
{
new MailServiceForGmail.DTO.ToAndCCMailDTO()
{ MailAddress = "toMail,DisplayName = "displayName" }
},
Priority = System.Net.Mail.MailPriority.High,
UseCertificate = true,
Path = htmlPath,
NewHtmlReplaceText = "newText",
OldHtmlReplaceText = "oldText"
});
}
}
Other Applications
- Class.cs
var MailService = new MailService.Concrete.MailService(new MailSetting { Host = "host", Password = "password", Port = port, SenderMail = "mail" });
Standart Message
var model = MailService.SendMessage(new MailServiceForGmail.DTO.ClientMailInfoDTO() { Body = "body", DisplayName = "displayName", EnableSSL = false, Subject = "subject", UseDefaultCredentials = true, ToMails = new List<MailServiceForGmail.DTO.ToAndCCMailDTO>() { new MailServiceForGmail.DTO.ToAndCCMailDTO() { MailAddress = "toMail",DisplayName = "displayName" } }, Priority = System.Net.Mail.MailPriority.High, UseCertificate = true }); } }
* Html Message
```sh
var model = MailService.SendMessageWithHtml(
new MailServiceForGmail.DTO.ClientMailInfoWithHtmlDTO()
{
DisplayName = "displayName",
EnableSSL = true,
Subject = "subject",
UseDefaultCredentials = true,
ToMails = new List<MailServiceForGmail.DTO.ToAndCCMailDTO>()
{
new MailServiceForGmail.DTO.ToAndCCMailDTO()
{ MailAddress = "toMail,DisplayName = "displayName" }
},
Priority = System.Net.Mail.MailPriority.High,
UseCertificate = true,
Path = htmlPath,
NewHtmlReplaceText = "newText",
OldHtmlReplaceText = "oldText"
});
}
}
Errors
Errors |
---|
You can get the errors that occur in MailService from the above mentioned model. |
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
This package has 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.