Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
5bd3305
Merge branch 'master' into develop
lorddev Dec 5, 2022
c34f9c6
Merge branch 'master' into develop
lorddev Feb 17, 2026
384a037
Update README.md
lorddev Feb 17, 2026
11cc643
Update README.md
lorddev Feb 17, 2026
45a2f19
Prep packing for v7
lorddev Feb 17, 2026
3b0b1de
Merge remote-tracking branch 'origin/develop' into develop
lorddev Feb 17, 2026
d69f67e
Only pack the main project
lorddev Feb 17, 2026
f2f939b
Fix broken build
lorddev Feb 17, 2026
03c497f
Reconfigure without nuspec
lorddev Feb 17, 2026
7200808
Configuration
lorddev Feb 17, 2026
71bebe5
Remove Encryptamajig entirely
lorddev Feb 21, 2026
9a2969b
Remove encryption tags from NuGet
lorddev Feb 23, 2026
7b369b2
New PackageIcon
lorddev Feb 28, 2026
5ff0ce8
Separate Mail and MapsApi packages.
lorddev Feb 28, 2026
499254e
Merge remote-tracking branch 'origin/develop' into develop
lorddev Feb 28, 2026
3e52103
Fixed JSON serialization and updated READMEs
lorddev Feb 28, 2026
adeb290
Package config
lorddev Feb 28, 2026
7b465ee
Package config for 7.0.1
lorddev Feb 28, 2026
b14ba78
Merge remote-tracking branch 'origin/master' into develop
lorddev Feb 28, 2026
d783def
Nuget License configuration
lorddev Feb 28, 2026
8a22123
Merge remote-tracking branch 'origin/master' into develop
lorddev Feb 28, 2026
3b8a654
Skip unit tests that rely on user secrets
lorddev Feb 28, 2026
2d61005
help
lorddev Feb 28, 2026
b533ef1
Merge remote-tracking branch 'origin/master' into develop
lorddev Feb 28, 2026
a501abf
Merge branch 'master' into develop
lorddev Feb 28, 2026
b84941d
Update README.md
lorddev Feb 28, 2026
6812047
Update README.md
lorddev Feb 28, 2026
06c1f18
Update README.md
lorddev Feb 28, 2026
2eb3069
Update README.md
lorddev Feb 28, 2026
60d24d7
Update README.md
lorddev Feb 28, 2026
d4a39fe
Update README.md
lorddev Feb 28, 2026
8fe5e04
Update README.md
lorddev Feb 28, 2026
e7a7196
Update README.md
lorddev Feb 28, 2026
58827ae
Update README.md
lorddev Feb 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
dotnet-version: 8.0.x

- name: Build release
run: dotnet build src/Devlord.Utilities/Devlord.Utilities.csproj --configuration Release
run: dotnet build --configuration Release
- name: Pack prerelease with build number
if: "github.event.release.prerelease"
run: |
Expand Down
Binary file added .nupkg/Devlord.Utilities.7.0.1-local.nupkg
Binary file not shown.
Binary file added .nupkg/Devlord.Utilities.Mail.7.0.1-local.nupkg
Binary file not shown.
29 changes: 16 additions & 13 deletions Devlord.Utilities.sln
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,20 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{33918F2B-0111-483C-B796-328D8AB07E35}"
ProjectSection(SolutionItems) = preProject
appveyor.yml = appveyor.yml
LICENSE = LICENSE
LICENSE.txt = LICENSE.txt
README.md = README.md
images\devlord-105.png = images\devlord-105.png
.github\workflows\dotnet.yml = .github\workflows\dotnet.yml
.github\workflows\package.yml = .github\workflows\package.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{D98FBDA4-114C-469D-A722-A8DB70F42BFE}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{F789018F-60C1-4E97-8E2F-5FFD41A008D1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Encryptamajig", "src\Encryptamajig\Encryptamajig.csproj", "{E5BACB77-AE20-4834-9AAA-DED949436118}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Devlord.Utilities.Mail", "src\Devlord.Utilities.Mail\Devlord.Utilities.Mail.csproj", "{5336A7B7-3BA1-4025-B39D-B831DEA65668}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Encryptamajig.Tests", "test\Encryptamajig.Tests\Encryptamajig.Tests.csproj", "{239FCC70-2688-4EAF-8C19-85A348840E34}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Devlord.Utilities.MapsApi", "src\Devlord.Utilities.MapsApi\Devlord.Utilities.MapsApi.csproj", "{C6AEABA2-94DD-4642-8DD8-8795DAAE797C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -36,23 +39,23 @@ Global
{F41E3A90-DCB2-4E86-B9A1-DC45B0DFB998}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F41E3A90-DCB2-4E86-B9A1-DC45B0DFB998}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F41E3A90-DCB2-4E86-B9A1-DC45B0DFB998}.Release|Any CPU.Build.0 = Release|Any CPU
{E5BACB77-AE20-4834-9AAA-DED949436118}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E5BACB77-AE20-4834-9AAA-DED949436118}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E5BACB77-AE20-4834-9AAA-DED949436118}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E5BACB77-AE20-4834-9AAA-DED949436118}.Release|Any CPU.Build.0 = Release|Any CPU
{239FCC70-2688-4EAF-8C19-85A348840E34}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{239FCC70-2688-4EAF-8C19-85A348840E34}.Debug|Any CPU.Build.0 = Debug|Any CPU
{239FCC70-2688-4EAF-8C19-85A348840E34}.Release|Any CPU.ActiveCfg = Release|Any CPU
{239FCC70-2688-4EAF-8C19-85A348840E34}.Release|Any CPU.Build.0 = Release|Any CPU
{5336A7B7-3BA1-4025-B39D-B831DEA65668}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5336A7B7-3BA1-4025-B39D-B831DEA65668}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5336A7B7-3BA1-4025-B39D-B831DEA65668}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5336A7B7-3BA1-4025-B39D-B831DEA65668}.Release|Any CPU.Build.0 = Release|Any CPU
{C6AEABA2-94DD-4642-8DD8-8795DAAE797C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C6AEABA2-94DD-4642-8DD8-8795DAAE797C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C6AEABA2-94DD-4642-8DD8-8795DAAE797C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C6AEABA2-94DD-4642-8DD8-8795DAAE797C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{BDA4FCBB-3582-42E0-B383-1BAB2BC69547} = {D98FBDA4-114C-469D-A722-A8DB70F42BFE}
{F41E3A90-DCB2-4E86-B9A1-DC45B0DFB998} = {F789018F-60C1-4E97-8E2F-5FFD41A008D1}
{E5BACB77-AE20-4834-9AAA-DED949436118} = {D98FBDA4-114C-469D-A722-A8DB70F42BFE}
{239FCC70-2688-4EAF-8C19-85A348840E34} = {F789018F-60C1-4E97-8E2F-5FFD41A008D1}
{5336A7B7-3BA1-4025-B39D-B831DEA65668} = {D98FBDA4-114C-469D-A722-A8DB70F42BFE}
{C6AEABA2-94DD-4642-8DD8-8795DAAE797C} = {D98FBDA4-114C-469D-A722-A8DB70F42BFE}
EndGlobalSection
GlobalSection(CodealikeProperties) = postSolution
SolutionGuid = 786e0001-a81c-40a8-96b1-bd100ef383c7
Expand Down
7 changes: 4 additions & 3 deletions Devlord.Utilities.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeStyle/FileHeader/FileHeaderText/@EntryValue">--------------------------------------------------------------------------------------------------------------------&#xD;
&lt;copyright file="$FILENAME$" company="Lord Design"&gt;&#xD;
© $CURRENT_YEAR$ Lord Design&#xD;
&lt;copyright file="${File.FileName}" company="Lord Design"&gt;&#xD;
© ${CurrentDate.Year} Lord Design&#xD;
&lt;/copyright&gt;&#xD;
&lt;license type="GPL-3.0"&gt;&#xD;
You may use freely and commercially without modification; if you make changes, please share back to the&#xD;
community. &#xD;
&lt;/license&gt;&#xD;
&lt;author&gt;$USER_NAME$&lt;/author&gt;&#xD;
&lt;author&gt;${User.Name}&lt;/author&gt;&#xD;
--------------------------------------------------------------------------------------------------------------------&#xD;
</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=DR/@EntryIndexedValue">DR</s:String>
<s:Boolean x:Key="/Default/Environment/Filtering/ExcludeCoverageFilters/=Devlord_002EUtilities_003B_002A_003BDevlord_002EUtilities_002EProperties_002E_002A_003B_002A/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/Filtering/ExcludeCoverageFilters/=Devlord_002EUtilities_003B_002A_003BDevlord_002EUtilities_002EResources_002E_002A_003B_002A/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EdotCover_002EIde_002ECore_002EFilterManagement_002EModel_002ESolutionFilterSettingsManagerMigrateSettings/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EFeature_002EServices_002ECodeCleanup_002EFileHeader_002EFileHeaderSettingsMigrate/@EntryIndexedValue">True</s:Boolean>
<s:String x:Key="/Default/FilterSettingsManager/CoverageFilterXml/@EntryValue">&lt;data&gt;&lt;IncludeFilters /&gt;&lt;ExcludeFilters&gt;&lt;Filter ModuleMask="Devlord.Utilities" ModuleVersionMask="*" ClassMask="Devlord.Utilities.Properties.*" FunctionMask="*" IsEnabled="True" /&gt;&lt;Filter ModuleMask="Devlord.Utilities" ModuleVersionMask="*" ClassMask="Devlord.Utilities.Resources.*" FunctionMask="*" IsEnabled="True" /&gt;&lt;/ExcludeFilters&gt;&lt;/data&gt;</s:String>
<s:Boolean x:Key="/Default/UserDictionary/Words/=botmail/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Devlord/@EntryIndexedValue">True</s:Boolean>
Expand Down
File renamed without changes.
25 changes: 13 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
devlord utilities
Devlord.Utilities
====================

A useful class library for universal utilities like consuming RESTful APIs.

A useful class library for universal utilities like encryption, sending emails, and consuming RESTful APIs.

| Master | Develop | NuGet |
| ----- | ----- | ----- |
| [![Build status](https://ci.appveyor.com/api/projects/status/i0us4v5jxi6llk3e/branch/master?svg=true)](https://ci.appveyor.com/project/lorddev/utilities/branch/master) | [![Build status](https://ci.appveyor.com/api/projects/status/i0us4v5jxi6llk3e/branch/develop?svg=true)](https://ci.appveyor.com/project/lorddev/utilities/branch/develop) | [![NuGet Package](https://buildstats.info/nuget/Devlord.Utilities)](https://www.nuget.org/packages/Devlord.Utilities/) |
| Main | Develop | NuGet |
| ----- | ----- | ----- |
| [![.NET](https://github.com/lorddev/utilities/actions/workflows/dotnet.yml/badge.svg)](https://github.com/lorddev/utilities/actions/workflows/dotnet.yml) | [![.NET](https://github.com/lorddev/utilities/actions/workflows/dotnet.yml/badge.svg?branch=develop)](https://github.com/lorddev/utilities/actions/workflows/dotnet.yml) | [![NuGet](https://img.shields.io/badge/nuget-%23004880.svg?style=for-the-badge&logo=nuget&logoColor=white)](https://www.nuget.org/packages/Devlord.Utilities/) |

To install Devlord.Utilities, run the following command in the Package Manager Console:

Expand All @@ -16,13 +15,20 @@ Or from the command-line:

dotnet add package Devlord.Utilities

### Breaking Changes

* Mail utilities have been moved to the Devlord.Utilities.Mail package.
* Maps API utilities have been moved to the Devlord.Utilities.MapsApi package.
* Encryption has been deprecated because the protocols are no longer recommended.
* UnderscoreContractResolver has been removed in favor of System.Text.Json snake case handling.
* ValueText.Value has been changed from string to decimal.

### Feature Summary

* .NET Core compatibility
* System.Threading.Timers service clocks
* Email throttling to help you avoid being suspended by your ISP
* Generic HTTP API wrappers
* Two-way AES encryption
* "Micro-ORM" DataReader mapper for when using a full-featured ORM would be overkill

More details below, but for even _more_ details, see the [project wiki](https://github.com/lorddev/utilities/wiki).
Expand Down Expand Up @@ -89,11 +95,6 @@ A multithreaded SMTP queued mail sender, has a configurable throttle for mail fr
}
```

### Crypt

Bidirectional encryption methods useful for storing credit cards or encrypting passwords or API keys to save in a project's
configuration files. (Not recommend for use with user's site credentials as those should use one-way encryption.)

### DRMapper

Allows mapping of an `IDataReader` to POCO classes using reflection. It's faster than you might expect.
Expand Down
Binary file added images/devlord-105.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
// <author>aaron@lorddesign.net</author>
// --------------------------------------------------------------------------------------------------------------------

using System.Collections.Generic;

namespace Devlord.Utilities
namespace Devlord.Utilities.Mail
{
/// <summary>
/// The botmail.
Expand All @@ -20,16 +18,16 @@
/// <summary>
/// Gets or sets the addressee.
/// </summary>
public IEnumerable<string> Addressees { get; set; }

Check warning on line 21 in src/Devlord.Utilities.Mail/Botmail.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'Addressees' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 21 in src/Devlord.Utilities.Mail/Botmail.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'Addressees' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 21 in src/Devlord.Utilities.Mail/Botmail.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'Addressees' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 21 in src/Devlord.Utilities.Mail/Botmail.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'Addressees' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

/// <summary>
/// Gets or sets the addresser.
/// </summary>
public string Addresser { get; set; }

Check warning on line 26 in src/Devlord.Utilities.Mail/Botmail.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'Addresser' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 26 in src/Devlord.Utilities.Mail/Botmail.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'Addresser' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 26 in src/Devlord.Utilities.Mail/Botmail.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'Addresser' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

public string Subject { get; set; }

Check warning on line 28 in src/Devlord.Utilities.Mail/Botmail.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'Subject' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 28 in src/Devlord.Utilities.Mail/Botmail.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'Subject' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

public string Body { get; set; }

Check warning on line 30 in src/Devlord.Utilities.Mail/Botmail.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'Body' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 30 in src/Devlord.Utilities.Mail/Botmail.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'Body' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

public bool Ssl { get; set; }

Expand Down
33 changes: 33 additions & 0 deletions src/Devlord.Utilities.Mail/Devlord.Utilities.Mail.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<VersionPrefix>7.0.1</VersionPrefix>
<Company>Devlords Cooperative</Company>
<Authors>devlord</Authors>
<PackageProjectUrl>https://github.com/lorddev/utilities</PackageProjectUrl>
<Copyright>Copyright © 2026 Aaron Lord</Copyright>
<PackageLicenseExpression>GPL-3.0-only</PackageLicenseExpression>
<PackageIcon>devlord-105.png</PackageIcon>
<RepositoryUrl>https://github.com/lorddev/utilities</RepositoryUrl>
<RepositoryType>Git</RepositoryType>
<PackageTags>utils utilities email gmail mailbot</PackageTags>
<PackageSummary>Utilities class library so you don't have to rewrite your utilities on every project.</PackageSummary>
<PackageReadmeFile>README.md</PackageReadmeFile>

</PropertyGroup>

<ItemGroup>
<None Include="..\..\LICENSE.txt" Pack="true" PackagePath="" />
<None Include="README.md" Pack="true" PackagePath="\" />
<None Include="..\..\images\devlord-105.png" Pack="true" PackagePath="" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Devlord.Utilities\Devlord.Utilities.csproj" />
<PackageReference Include="MailKit" Version="4.15.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;

namespace Devlord.Utilities
namespace Devlord.Utilities.Mail
{
public static class DevlordSettingsExtension
{
public static IServiceCollection AddDevlordUtilities(this IServiceCollection services,
public static IServiceCollection AddDevlordMail(this IServiceCollection services,
IConfiguration namedConfigurationSection)
{
services.Configure<DevlordOptions>(namedConfigurationSection);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Threading;
using System.Threading.Tasks;

namespace Devlord.Utilities
namespace Devlord.Utilities.Mail
{
/// <summary>
/// The throttles.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// <author>Aaron Lord</author>
// --------------------------------------------------------------------------------------------------------------------

namespace Devlord.Utilities
namespace Devlord.Utilities.Mail
{
public interface IMailbotFactory
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Devlord.Utilities
namespace Devlord.Utilities.Mail
{
public enum MailFormat
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@
// <author>aaron@lorddesign.net</author>
// --------------------------------------------------------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Linq;

namespace Devlord.Utilities
namespace Devlord.Utilities.Mail
{
/// <summary>
/// The mail throttle.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// --------------------------------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="Mailbot.cs" company="Lord Design">
// © Lord Design. Modified GPL: You may use freely and commercially without modification; you can modify if result
// is also free.
Expand All @@ -10,13 +10,11 @@
// <author>aaron@lorddesign.net</author>
// --------------------------------------------------------------------------------------------------------------------

using System.Threading.Tasks;
using Devlord.Utilities.Cryptography;
using MailKit.Net.Smtp;
using MailKit.Security;
using MimeKit;

namespace Devlord.Utilities
namespace Devlord.Utilities.Mail
{
/// <summary>
/// Multi-threaded mailer to keep your systems running by sending messages asynchronously. If you're using it in a
Expand All @@ -26,8 +24,6 @@
{
#region Fields

private readonly Crypt _crypt = new Crypt();

/// <summary>
/// The throttles.
/// </summary>
Expand All @@ -40,17 +36,8 @@
/// <summary>
/// Private constructor to enforce use of singleton.
/// </summary>
internal Mailbot()

Check warning on line 39 in src/Devlord.Utilities.Mail/Mailbot.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'SmtpPassword' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 39 in src/Devlord.Utilities.Mail/Mailbot.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'SmtpLogin' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 39 in src/Devlord.Utilities.Mail/Mailbot.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'SmtpServer' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 39 in src/Devlord.Utilities.Mail/Mailbot.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'SmtpPassword' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 39 in src/Devlord.Utilities.Mail/Mailbot.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'SmtpLogin' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 39 in src/Devlord.Utilities.Mail/Mailbot.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'SmtpServer' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.
{
_crypt.Key = new byte[]
{
80, 20, 245, 0, 124, 61, 192, 137, 232, 79, 249, 228, 1, 246, 187, 3, 228, 215, 250, 11,
131, 33, 180, 143, 41, 217, 4, 16, 219, 34, 50, 115, 96, 140, 146, 24, 5, 69, 58, 183, 66, 88, 58, 44,
213, 81, 26, 187, 247, 101, 163, 248, 103, 3, 179, 60, 14, 152, 90, 230, 92, 69, 100, 246, 32, 27, 201,
123, 99, 229, 66, 118, 185, 241, 136, 38, 174, 104, 203, 207, 4, 175, 223, 104, 140, 234, 20, 228, 209,
175, 94, 212, 105, 165, 47, 61, 100, 219, 18,
224
};
}

#endregion
Expand All @@ -64,7 +51,7 @@

public int SmtpPort { get; internal set; }
public string SmtpLogin { get; internal set; }
public string EncryptedPassword { get; internal set; }
public string SmtpPassword { get; internal set; }

#endregion

Expand All @@ -83,19 +70,18 @@
Throttles.Wait();

var mm = new MimeMessage();
mm.From.Add(new MailboxAddress(botmail.Addresser));
mm.From.Add(MailboxAddress.Parse(botmail.Addresser));
mm.Subject = botmail.Subject;
mm.Body = new TextPart(botmail.Format.ToString().ToLower())
{
Text = botmail.Body
};

botmail.Addressees.ForEach(a => mm.To.Add(new MailboxAddress(a)));
botmail.Addressees.ForEach(a => mm.To.Add(MailboxAddress.Parse(a)));
using (var client = new SmtpClient())
{
client.Connect(SmtpServer, SmtpPort, SecureSocketOptions.SslOnConnect);
await client.AuthenticateAsync(SmtpLogin,
_crypt.DecryptSecret(EncryptedPassword));
await client.ConnectAsync(SmtpServer, SmtpPort, SecureSocketOptions.SslOnConnect);
await client.AuthenticateAsync(SmtpLogin, SmtpPassword);
await client.SendAsync(mm);
Throttles.Increment();
client.Disconnect(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@
// <author>Aaron Lord</author>
// --------------------------------------------------------------------------------------------------------------------

using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using Devlord.Utilities.Exceptions;
using Microsoft.Extensions.Options;

[assembly: InternalsVisibleTo("Devlord.Utilities.Tests")]
namespace Devlord.Utilities
namespace Devlord.Utilities.Mail
{
public class MailbotFactory : IMailbotFactory
{
Expand Down Expand Up @@ -56,7 +54,7 @@ public Mailbot GetMailbot(string name)
SmtpServer = thisOptions.SmtpServer,
SmtpPort = thisOptions.SmtpPort,
SmtpLogin = thisOptions.SmtpLogin,
EncryptedPassword = thisOptions.SmtpPassword,
SmtpPassword = thisOptions.SmtpPassword,
Throttles = new Throttles(thisOptions.MaxPerMinute, thisOptions.MaxPerHour, thisOptions.MaxPerDay)
};

Expand Down
Loading