diff --git a/ImageBoardServerApp/Program.cs b/ImageBoardServerApp/Program.cs index a1e72ce..a92225f 100644 --- a/ImageBoardServerApp/Program.cs +++ b/ImageBoardServerApp/Program.cs @@ -1,5 +1,6 @@ using ImageBoardServerApp.Auth; using ImageBoardServerApp.Data; +using ImageBoardServerApp.Util; using ImageThumbnail.AspNetCore.Middleware; using Microsoft.AspNetCore.Components.Authorization; using Microsoft.AspNetCore.Components.Server.ProtectedBrowserStorage; @@ -43,4 +44,7 @@ ImageThumbnailOptions options = new ImageThumbnailOptions("wwwroot/img/", "thumb options.ImageQuality = 75L; app.UseImageThumbnail(options); +//Log onto Mail Server +Postman.logon(); + app.Run(); \ No newline at end of file diff --git a/ImageBoardServerApp/Util/Postman.cs b/ImageBoardServerApp/Util/Postman.cs new file mode 100644 index 0000000..0ac78b3 --- /dev/null +++ b/ImageBoardServerApp/Util/Postman.cs @@ -0,0 +1,25 @@ +using System.Net; +using System.Net.Mail; + +namespace ImageBoardServerApp.Util; + +public static class Postman +{ + private static SmtpClient smtpClient; + + public static void logon() + { + smtpClient = new SmtpClient("smtp.bulletboards.xyz") + { + Port = 587, + Credentials = new NetworkCredential("noreply@bulletboards.xyz", "frogARdI,97,#"), + EnableSsl = true, + }; + } + + public static void sendMail(string to, string subj, string body) + { + smtpClient.Send("noreply@bulletboards.xyz", to, subj, body); + } + +} \ No newline at end of file