TPJ.Email
3.0.0
See the version list below for details.
dotnet add package TPJ.Email --version 3.0.0
NuGet\Install-Package TPJ.Email -Version 3.0.0
<PackageReference Include="TPJ.Email" Version="3.0.0" />
paket add TPJ.Email --version 3.0.0
#r "nuget: TPJ.Email, 3.0.0"
// Install TPJ.Email as a Cake Addin #addin nuget:?package=TPJ.Email&version=3.0.0 // Install TPJ.Email as a Cake Tool #tool nuget:?package=TPJ.Email&version=3.0.0
TPJ E-mail library - Easily send e-mails, light weight, easy to setup!
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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 was computed. 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. |
-
.NETStandard 2.0
- Microsoft.Extensions.Configuration (>= 2.0.0)
- Microsoft.Extensions.DependencyInjection (>= 2.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
V3.0.0+ only supports .netstandard2.0, which works in .net4.6.1 + / .netcore2.0 +. If you are using .net4.5.2 / .net 4.6 you can use TPJ.Email V2.X.X.
ASP.Net Core Website / WebAPI Set up
Within appsettings.json and add the following
{
"TPJ": {
"Email":{
"From": "",
"SmtpClient": "",
"SmtpUser": "",
"SmtpPassword": "",
"Port": "",
"EnableSSL": ""
}
}
}
From - (Required) E-mails are sent from this account
SmtpClient – (Required) SMTP server which e-mails will be sent from
SmtpUser - (Not required) send e-mail using the given user name and password
SmtpPassword - (Not required) send e-mail using the given user name and password
Port - (Not required) port to send from
EnableSSL - (Not required) enable SSL when sending the e-mail
Example appsettings.json setup using Gmail to send error e-mails –
{
"TPJ": {
"Email":{
"From": "test@gmail.com",
"SmtpClient": "smtp.gmail.com",
"SmtpUser": "test@gmail.com",
"SmtpPassword": "testPassword",
"Port": "587",
"EnableSSL": "true"
}
}
}
Once appsettings.json is done open StartUp.cs file, add the following using -
using TPJ.Email;
then go to ConfigureServices
services.AddTPJEmail();
Then using DI within asp.net core you can call IEmailer like so
private readonly TPJ.Email.IEmailer _email;
public HomeController(TPJ.Email.IEmailer email)
{
_email= email;
}
Then within an IActionResult you might have this
public IActionResult SendSuperEpicEmail()
{
_email.Send("epicPerson@gmail.com", "Super Epic Email", "This is a super epic email message", false);
return View();
}
This will then send an e-mail to epicPerson@gmail.com using the SMTP details you set up sending as the person you set in the config