yuck
This commit is contained in:
parent
0a34928c87
commit
b134ad2139
1 changed files with 5 additions and 3 deletions
|
|
@ -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
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue