Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
StartTlsCommand.cs
Go to the documentation of this file.
1namespace System.Net.Mail;
2
3internal static class StartTlsCommand
4{
5 internal static IAsyncResult BeginSend(SmtpConnection conn, AsyncCallback callback, object state)
6 {
7 PrepareCommand(conn);
8 return CheckCommand.BeginSend(conn, callback, state);
9 }
10
11 private static void CheckResponse(SmtpStatusCode statusCode, string response)
12 {
13 if (statusCode != SmtpStatusCode.ServiceReady)
14 {
15 if (statusCode != SmtpStatusCode.ClientNotPermitted)
16 {
17 }
18 if (statusCode < (SmtpStatusCode)400)
19 {
21 }
22 throw new SmtpException(statusCode, response, serverResponse: true);
23 }
24 }
25
26 internal static void EndSend(IAsyncResult result)
27 {
28 string response;
29 SmtpStatusCode statusCode = (SmtpStatusCode)CheckCommand.EndSend(result, out response);
30 CheckResponse(statusCode, response);
31 }
32
42
43 internal static void Send(SmtpConnection conn)
44 {
45 PrepareCommand(conn);
46 string response;
47 SmtpStatusCode statusCode = CheckCommand.Send(conn, out response);
48 CheckResponse(statusCode, response);
49 }
50}
static SmtpStatusCode Send(SmtpConnection conn, out string response)
static IAsyncResult BeginSend(SmtpConnection conn, AsyncCallback callback, object state)
static object EndSend(IAsyncResult result, out string response)
static readonly byte[] CRLF
static readonly byte[] StartTls
static void Send(SmtpConnection conn)
static IAsyncResult BeginSend(SmtpConnection conn, AsyncCallback callback, object state)
static void CheckResponse(SmtpStatusCode statusCode, string response)
static void EndSend(IAsyncResult result)
static void PrepareCommand(SmtpConnection conn)
static string net_webstatus_ServerProtocolViolation
Definition SR.cs:152
static string SmtpDataStreamOpen
Definition SR.cs:154
Definition SR.cs:7