SY.EmailHelper
1.0.0
dotnet add package SY.EmailHelper --version 1.0.0
NuGet\Install-Package SY.EmailHelper -Version 1.0.0
<PackageReference Include="SY.EmailHelper" Version="1.0.0" />
<PackageVersion Include="SY.EmailHelper" Version="1.0.0" />
<PackageReference Include="SY.EmailHelper" />
paket add SY.EmailHelper --version 1.0.0
#r "nuget: SY.EmailHelper, 1.0.0"
#:package SY.EmailHelper@1.0.0
#addin nuget:?package=SY.EmailHelper&version=1.0.0
#tool nuget:?package=SY.EmailHelper&version=1.0.0
EmailManager
介绍
基于.NetCore3.1的 包含IMAP、POP3、Exchange、SMTP协议的跨平台收发邮件系统
MailKit
这是一个基于MimeKit的跨平台.NET邮件库,支持IMAP、POP3、SMTP协议。它相比.NET自带的SmtpClient,支持更广泛的协议和更现代的电子邮件标准。因此微软官方建议,SmtpClient只用来兼容老应用,如果开发新应用的话,直接使用MailKit。
因此本系统中采用了MailKit来做邮件的收发!
Exchange
Exchange:微软推出的邮件服务器软件。
Exchange Server 是微软公司的一套电子邮件服务组件,是个消息与协作系统。 简单而言,Exchange server可以被用来构架应用于企业、学校的邮件系统。
使用说明
- 在单元测试项目中,ConfigSetting中添加相应的邮箱配置即可, eg 163邮箱:
//IMAP配置 public static string IMApServer = "imap.163.com";
public static int IMAPPort = 993;
public static bool IMAPIsSsl = true;
public static string IMAPAccount = "";
public static string IMAPPassword = "";
在IMAPAccount和IMAPPassword处填上自己的邮箱账号和密码,即可测试收邮件。
2 . 邮件发送
传入邮件实体(发件人、收件人/抄送人、主题、内容)和邮箱配置(smtp服务器地址和端口、账号、密码)
public static SendResultEntity Send(EmailModel messge, ServerConfigurationEntity serverConfigurationEntity)
| 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. 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. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp3.1 is compatible. |
-
.NETCoreApp 3.1
- MailKit (>= 2.8.0)
- Microsoft.Exchange.WebServices.NETStandard (>= 1.1.3)
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 |
|---|---|---|
| 1.0.0 | 498 | 7/6/2021 |