From f3e437a9809f4f36b56af29201ae934a55966ebb Mon Sep 17 00:00:00 2001
From: "nathaniel.mitchell" <29741794+Nephiaust@users.noreply.github.com>
Date: Wed, 25 Sep 2024 16:17:53 +1000
Subject: [PATCH] Updated modules, removed old BouncyCastle module (name
changed) Added output of send mail command to be returned to script (for
checking if mail was sent)
---
Project/Send-MailKitMessage.csproj | 8 ++++----
Project/Send_MailKitMessage.cs | 3 ++-
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/Project/Send-MailKitMessage.csproj b/Project/Send-MailKitMessage.csproj
index 359785a..f49677d 100644
--- a/Project/Send-MailKitMessage.csproj
+++ b/Project/Send-MailKitMessage.csproj
@@ -20,10 +20,10 @@
-
-
-
-
+
+
+
+
All
diff --git a/Project/Send_MailKitMessage.cs b/Project/Send_MailKitMessage.cs
index 2cc2fa9..74e3582 100644
--- a/Project/Send_MailKitMessage.cs
+++ b/Project/Send_MailKitMessage.cs
@@ -4,6 +4,7 @@
using System.Management.Automation;
using System.Reflection;
using System.Web;
+using System.Xml.Linq;
namespace Send_MailKitMessage
{
@@ -160,7 +161,7 @@ protected override void ProcessRecord()
{
Client.Authenticate(Credential.UserName, (System.Runtime.InteropServices.Marshal.PtrToStringAuto(System.Runtime.InteropServices.Marshal.SecureStringToBSTR(Credential.Password))));
}
- Client.Send(Message);
+ WriteObject(Client.Send(Message));
}
catch (Exception e)