Info
Version: | 1.0.1 |
Author(s): | azrng |
Last Update: | Saturday, December 19, 2020 |
.NET Fiddle: | Create the first Fiddle |
NuGet Url: | https://www.nuget.org/packages/Common.SendEmail |
Install
Install-Package Common.SendEmail
dotnet add package Common.SendEmail
paket add Common.SendEmail
Common.SendEmail Download (Unzip the "nupkg" after downloading)
Dependencies
- MailKit(>= 2.10.0)
- Microsoft.Extensions.DependencyInjection.Abstractions(>= 3.1.9)
- Microsoft.Extensions.Logging.Abstractions(>= 3.1.9)
- Microsoft.Extensions.Options(>= 3.1.9)
startup类添加配置:
services.AddEmail(info =>
{
info.Host = "smtp.163.com";
info.Post = 587;
info.FromName = "发送者用户名";
info.FromAddress = "发送者地址";
info.FromPassword = "发送者密码(授权码)";
});
然后注入:IEmailHelper.