CompuMaster.Net.Smtp 2025.1.10.100

dotnet add package CompuMaster.Net.Smtp --version 2025.1.10.100
                    
NuGet\Install-Package CompuMaster.Net.Smtp -Version 2025.1.10.100
                    
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="CompuMaster.Net.Smtp" Version="2025.1.10.100" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CompuMaster.Net.Smtp" Version="2025.1.10.100" />
                    
Directory.Packages.props
<PackageReference Include="CompuMaster.Net.Smtp" />
                    
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 CompuMaster.Net.Smtp --version 2025.1.10.100
                    
#r "nuget: CompuMaster.Net.Smtp, 2025.1.10.100"
                    
#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.
#addin nuget:?package=CompuMaster.Net.Smtp&version=2025.1.10.100
                    
Install CompuMaster.Net.Smtp as a Cake Addin
#tool nuget:?package=CompuMaster.Net.Smtp&version=2025.1.10.100
                    
Install CompuMaster.Net.Smtp as a Cake Tool

CompuMaster.Network.Smtp

SMTP messaging with support for alternative body and embedded images

Simple download/installation using NuGet

Install-Package CompuMaster.Network.Smtp

Sample: Quick initialization of SMTP component

C#

using System.Collections.Generic;
using CompuMaster.Net.Smtp;
...
SmtpWorker MySmtpWorker = new SmtpWorker();
MySmtpWorker.SmtpServerName = "localhost";
MySmtpWorker.SmtpServerPort = 465;
MySmtpWorker.SmtpAuthType = SmtpWorker.SmtpAuthTypes.LoginSsl;
MySmtpWorker.SmtpUserName = "user";
MySmtpWorker.SmtpPassword = "password";

VB.NET

Imports System.Collections.Generic
Imports CompuMaster.Net.Smtp
...
Dim MySmtpWorker As New SmtpWorker()
MySmtpWorker.SmtpServerName = "localhost"
MySmtpWorker.SmtpServerPort = 465
MySmtpWorker.SmtpAuthType = SmtpWorker.SmtpAuthTypes.LoginSsl
MySmtpWorker.SmtpUserName = "user"
MySmtpWorker.SmtpPassword = "password"

Sample: Prepare a message with alternative message parts and attachment for embedded image

C#

EMailAttachment MyAttachment = new EMailAttachment("logo_64x64.png", "logo");
List<EMailAttachment> Attachments = new List<EMailAttachment>(new EMailAttachment[] { MyAttachment });
EMailAddress Recipient = new EMailAddress(My.Settings.TestRecipientName, My.Settings.TestRecipientAddress);
EMailAddress Sender = new EMailAddress(My.Settings.TestSenderName, My.Settings.TestSenderAddress);
EMailAddress ReplyToAddress = Sender;
EMailMessage MyMessage = new EMailMessage(
         Recipient, 
         "TestSubject", 
         "Plain body", 
         "<h1>HTML body with embedded image</h1><img src=\"cid:" + MyAttachment.PlaceholderInMhtmlToBeReplacedByContentID + "\">", 
         Sender, 
         ReplyToAddress, 
         System.Text.Encoding.UTF8, 
         Attachments, 
         EMails.Priority.High, 
         EMails.Sensitivity.Normal, 
         false, 
         false, 
         (System.Collections.Specialized.NameValueCollection)null
         );

VB.NET

Dim MyAttachment As New EMailAttachment("logo_64x64.png", "logo")
Dim Attachments As New List(Of EMailAttachment)(New EMailAttachment() {MyAttachment})
Dim Recipient As New EMailAddress(My.Settings.TestRecipientName, My.Settings.TestRecipientAddress)
Dim Sender As New EMailAddress(My.Settings.TestSenderName, My.Settings.TestSenderAddress)
Dim ReplyToAddress As EMailAddress = Sender
Dim MyMessage As New EMailMessage(Recipient,
         "TestSubject",
         "Plain body",
         "<h1>HTML body with embedded image</h1><img src=""cid:" & MyAttachment.PlaceholderInMhtmlToBeReplacedByContentID & """>",
         Sender,
         ReplyToAddress,
         System.Text.Encoding.UTF8,
         Attachments,
         EMails.Priority.High,
         EMails.Sensitivity.Normal,
         False,
         False,
         CType(Nothing, Specialized.NameValueCollection)
         )

Sample: Send demo e-mail and check for exceptions

C#

CompuMaster.Net.Smtp.SmtpSendResult SendResult;
SendResult = MySmtpWorker.SendMessage(MyMessage);
if (SendResult.Success)
    System.Console.WriteLine("EMAIL SENT SUCCESSFULLY :-)");
else
    System.Console.WriteLine("FAILURE: " + SendResult.Exception.ToString());

VB.NET

Dim SendResult As CompuMaster.Net.Smtp.SmtpSendResult
SendResult = MySmtpWorker.SendMessage(MyMessage)
If SendResult.Success Then
    System.Console.WriteLine("EMAIL SENT SUCCESSFULLY :-)")
Else
    System.Console.WriteLine("FAILURE: " & SendResult.Exception.ToString)
End If
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 is compatible.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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
2025.1.10.100 105 1/10/2025
2021.8.27.100 820 8/27/2021
2021.7.15.100 386 7/15/2021
2021.3.2.100 402 3/2/2021
2020.6.12.100 580 6/12/2020
2020.6.1.100 499 6/1/2020
2020.1.30.100 536 1/30/2020
2020.1.28.101 518 1/28/2020
2020.1.28.100 544 1/28/2020
2020.1.9.100 546 1/8/2020
2020.1.8.100 556 1/8/2020
2020.1.6.100 528 1/7/2020