This commit is contained in:
mark 2010-10-17 02:38:20 +00:00
parent 0a34928c87
commit b134ad2139

View file

@ -36,19 +36,21 @@ namespace Server.Misc
return _pattern.IsMatch( address ); return _pattern.IsMatch( address );
} }
public static SmtpClient Client; private static SmtpClient _Client;
public static void Configure() public static void Configure()
{ {
if ( EmailServer != null ) if ( EmailServer != null )
Client = new SmtpClient( EmailServer ); _Client = new SmtpClient( EmailServer );
} }
public static bool Send( MailMessage message ) public static bool Send( MailMessage message )
{ {
try try
{ {
Client.Send( message ); lock ( _Client ) {
_Client.Send( message );
}
} }
catch catch
{ {