Rhetos.SimpleSPRTEmail 6.0.0

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

SimpleSPRTEmail

SimpleSPRTEmail is a plugin package for Rhetos development platform. It allows sending simple emails on "Send password reset token" authentication service method at AspNetFormsAuth.

  1. Installation and configuration
    1. Connecting to an SMTP email server
    2. Entering user's email address
    3. Email content and format
  2. Troubleshooting
  3. How to contribute

Installation and configuration

Installing this package to a Rhetos application:

  1. Add "Rhetos.SimpleSPRTEmail" NuGet package, available at the NuGet.org on-line gallery.

Connecting to an SMTP email server

SimpleSPRTEmail uses System.Net.Mail classes from .NET Framework for sending an email to an SMTP server.

Specify SMTP configuration in the application's configuration file (for example, in appsettings.json). See documentation on SmtpClient class for description of each property. For properties that are not specified in configuration, default SmtpClient settings will be used.

Example:

{
    "SimpleSPRTEMail": {
        "Smpt": {
            "From": "username@gmail.com",
            "Host": "smtp.gmail.com",
            "Port": 587,
            "EnableSsl": true,
            "UserName": "username",
            "Password": "password",
            "DefaultCredentials": false,
            "TargetName": null
        }
    }
}

For advanced configuration, register a custom implementation of Rhetos.AspNetFormsAuth.SimpleSPRTEmail.ISmptClientProvider.

Entering user's email address

SimpleSPRTEmail package adds the Email property (ShortString) to the Common.Principal entity. Use CRUD operations on Common.Principal to edit the user's email address.

Email content and format

Email content and format is defined in SimpleSPRTEmail.EmailFormat entity. The entity should contain exactly one record.

The email format can be a plain-text or HTML (Bool IsBodyHtml).

The email body may contain the following special tokens:

  • {UserName} → will be replaced with the username.
  • {Token} → will be replaced with the generated password reset token.

Troubleshooting

In case of a server error, additional information on the error may be found in the Rhetos app's log file (RhetosServer.log for Rhetos v1-v4). If needed, more verbose logging of the authentication service may be switched on by enabling Trace level loggers AspNetFormsAuth.AuthenticationService and SimpleSPRTEmail.EmailSender.

For example, in Rhetos v1-v4 add <logger name="AspNetFormsAuth.AuthenticationService" minLevel="Trace" writeTo="TraceLog" /> and <logger name="SimpleSPRTEmail.EmailSender" minLevel="Trace" writeTo="TraceLog" /> in Rhetos application's web.config or nlog.config, then the trace log will be written to RhetosServerTrace.log.

Similar logging configuration will work in Rhetos 5 if using NLog.

How to contribute

Contributions are very welcome. The easiest way is to fork this repo, and then make a pull request from your fork. The first time you make a pull request, you may be asked to sign a Contributor Agreement. For more info see How to Contribute on Rhetos wiki.

Building the source code:

  • Note: This package is already available at the NuGet.org online gallery. You don't need to build it from source in order to use it in your application.
  • To build the package from source, run Clean.bat and Build.bat.
  • The build output is a NuGet package in the "Install" subfolder.
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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.  net10.0 was computed.  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
6.0.0 126 9/8/2025
5.0.0 580 3/25/2022
2.0.0 869 10/11/2019