Bodoconsult.Web.Mail
1.0.11
dotnet add package Bodoconsult.Web.Mail --version 1.0.11
NuGet\Install-Package Bodoconsult.Web.Mail -Version 1.0.11
<PackageReference Include="Bodoconsult.Web.Mail" Version="1.0.11" />
<PackageVersion Include="Bodoconsult.Web.Mail" Version="1.0.11" />
<PackageReference Include="Bodoconsult.Web.Mail" />
paket add Bodoconsult.Web.Mail --version 1.0.11
#r "nuget: Bodoconsult.Web.Mail, 1.0.11"
#:package Bodoconsult.Web.Mail@1.0.11
#addin nuget:?package=Bodoconsult.Web.Mail&version=1.0.11
#tool nuget:?package=Bodoconsult.Web.Mail&version=1.0.11
What does the library
Bodoconsult.Web.Mail library is intended for apps which have to send (but not receive) SMTP mails like console apps.
Mass mail handling features are in an experimental state or work is in progress.
How to use the library
The source code contain a NUnit test classes, the following source code is extracted from. The samples below show the most helpful use cases for the library.
Send a simple mail with plain text via SMTP
var account = new SmtpMailAccount
{
SmtpServer = "smtp.test.de",
SmtpPassword = "test123!",
SmtpAccountName = "test@test.de",
MailAddressSender = "noreply@test.de",
UseSecureConnection = true
};
var smtp = new SmtpMailer(account);
smtp.Init();
smtp.Logon();
smtp.SendMail("to@test.de", "Testmail", "dgdgdgdgdgs sfsgdgs sshshsh");
Send a HTML mail via SMTP
var account = new SmtpMailAccount
{
SmtpServer = "smtp.test.de",
SmtpPassword = "test123!",
SmtpAccountName = "test@test.de",
MailAddressSender = "noreply@test.de",
UseSecureConnection = true
};
var msg = new MailMessage {IsBodyHtml = true};
var add = new MailAddress(account.MailAddressSender);
msg.From = add;
add = new MailAddress(TestHelper.GetTestReceiver());
msg.To.Add(add);
msg.Subject = "Bodoconsult.Core.Web.Mail: test mail";
msg.Body = "<p>ajHA SADad asd AS Ddad</p>";
var smtp = new SmtpMailer(account);
smtp.Init();
smtp.Logon();
smtp.SendMail(msg);
Send a HTML mail via Office 365 (Graph)
var account = new O365MailAccount
{
ClientId = ""),
ClientSecret = "",
Scope = "https://graph.microsoft.com/.default",
Instance = "https://login.microsoftonline.com/{0}",
Tenant = "",
UserName = ""
};
var mailer = new O365Mailer(account);
mailer.Init();
mailer.Logon();
mailer.SendMail("to@test.de", "Testmail", "dgdgdgdgdgs sfsgdgs sshshsh");
About us
Bodoconsult (http://www.bodoconsult.de) is a Munich based software development company from Germany.
Robert Leisner is senior software developer at Bodoconsult. See his profile on http://www.bodoconsult.de/Curriculum_vitae_Robert_Leisner.pdf.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- Bodoconsult.App (>= 1.0.11)
- Bodoconsult.App.Abstractions (>= 1.0.11)
- MailKit (>= 4.18.1)
- Microsoft.Extensions.Http (>= 10.0.13)
- Microsoft.Graph (>= 6.8.0)
- Microsoft.Identity.Web.GraphServiceClient (>= 4.16.1)
- Newtonsoft.Json (>= 13.0.4)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Updated dependencies and added README.md