From b134ad2139587f86ab3733fb0d42fe35cbfe3e36 Mon Sep 17 00:00:00 2001 From: mark Date: Sun, 17 Oct 2010 02:38:20 +0000 Subject: [PATCH] yuck --- Scripts/Misc/Email.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Scripts/Misc/Email.cs b/Scripts/Misc/Email.cs index 891b98e03..9f0dd0dc6 100644 --- a/Scripts/Misc/Email.cs +++ b/Scripts/Misc/Email.cs @@ -36,19 +36,21 @@ namespace Server.Misc return _pattern.IsMatch( address ); } - public static SmtpClient Client; + private static SmtpClient _Client; public static void Configure() { if ( EmailServer != null ) - Client = new SmtpClient( EmailServer ); + _Client = new SmtpClient( EmailServer ); } public static bool Send( MailMessage message ) { try { - Client.Send( message ); + lock ( _Client ) { + _Client.Send( message ); + } } catch {