Jasmin.SimpleSMTP
1.0.0
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
<PackageReference Include="Jasmin.SimpleSMTP" Version="1.0.0" />
paket add Jasmin.SimpleSMTP --version 1.0.0
#r "nuget: Jasmin.SimpleSMTP, 1.0.0"
// 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:
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)
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"
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 | Versions 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. |
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.