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
                    
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="Bodoconsult.Web.Mail" Version="1.0.11" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Bodoconsult.Web.Mail" Version="1.0.11" />
                    
Directory.Packages.props
<PackageReference Include="Bodoconsult.Web.Mail" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Bodoconsult.Web.Mail --version 1.0.11
                    
#r "nuget: Bodoconsult.Web.Mail, 1.0.11"
                    
#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.
#:package Bodoconsult.Web.Mail@1.0.11
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Bodoconsult.Web.Mail&version=1.0.11
                    
Install as a Cake Addin
#tool nuget:?package=Bodoconsult.Web.Mail&version=1.0.11
                    
Install as a Cake Tool

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.11 66 11/2/2026
1.0.10 55 11/2/2026

Updated dependencies and added README.md