Jasmin.SimpleSMTP 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Jasmin.SimpleSMTP --version 1.0.0                
NuGet\Install-Package Jasmin.SimpleSMTP -Version 1.0.0                
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="Jasmin.SimpleSMTP" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Jasmin.SimpleSMTP --version 1.0.0                
#r "nuget: Jasmin.SimpleSMTP, 1.0.0"                
#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.
// Install Jasmin.SimpleSMTP as a Cake Addin
#addin nuget:?package=Jasmin.SimpleSMTP&version=1.0.0

// Install Jasmin.SimpleSMTP as a Cake Tool
#tool nuget:?package=Jasmin.SimpleSMTP&version=1.0.0                

Learn Simple SMTP by adding this package to a basic console App and refactor later using Dependency Inversion Principle in your real solution:

Recommended Steps:

  1. Fill emailRequest object (Recommend method, such as: PrepareEmailMethod)

    var emailRequest = new MailRequest();

    emailRequest.Subject = "This is my Subject"; // Add your subject

    emailRequest.Body = "This is the body that will be wrapped inside a div tag";

    emailRequest.Sender. DisplayName="John Smith"; // Sender's Name

    emailRequest.Sender.Address = "Test@gmail.com"; // Sender's Email Address

    emailRequest.AddToRecipient("SendingTo@abc.com","Sue Recipient") // Repeat for additional "To" Recipients

    emailRequest.AddCcRecipient("SendingToCC@xyz.com","Sue CC") // Repeat for additional "Cc" Recipients

    emailRequest.AddBCcRecipient("SendingToBcc@zyx.com","Sue bcc") // Repeat for additional "Cc"

    emailRequest.AddFile("\Path\Filename.extension", "NameItThisInEmail.txt") // Repeat for addition file(s)

  2. Fill SMTP Settings (Recommend Method, such as: PrepareSmtpSetting) - This is where most people struggle as this information vary by company, environment, etc. You may have to consult your IT Technical Staff for the Host Name, and Port at a minimum. Please see Gmail for Password requirement; if you're using "smtp.gmail.com" as your host name (Search for "sign in with app passwords - google account help" in your favorite browser).

    var smtpSetting = new SmtpSetting();

    smtpSetting .Host.Name = "smtp.gmail.com" // Use your own, example only

    smtpSetting .Host.Port = 587

    smtpSetting .UserName = "Test@gmail.com"

    smtpSetting .Host.Password = "YourAppEmailPassword"

  3. Get Email Service Object and pass it the SMTP Settings

    var emailService = new EmailService(smtpSetting);

    emailService.SendEmailAsync(emailRequest).Wait();

And You're done, provided that SMTP information was properly obtained from your provided

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  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. 
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
2.1.11 164 9/13/2023
2.1.10 128 9/12/2023
1.0.0 121 9/11/2023