Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
DataCommand.cs
Go to the documentation of this file.
1namespace System.Net.Mail;
2
3internal static class DataCommand
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 serverResponse)
12 {
13 if (statusCode == SmtpStatusCode.StartMailInput)
14 {
15 return;
16 }
17 switch (statusCode)
18 {
19 default:
20 if (statusCode < (SmtpStatusCode)400)
21 {
23 }
24 throw new SmtpException(statusCode, serverResponse, serverResponse: true);
25 }
26 }
27
28 internal static void EndSend(IAsyncResult result)
29 {
30 string response;
31 SmtpStatusCode statusCode = (SmtpStatusCode)CheckCommand.EndSend(result, out response);
32 CheckResponse(statusCode, response);
33 }
34
35 private static void PrepareCommand(SmtpConnection conn)
36 {
37 if (conn.IsStreamOpen)
38 {
40 }
42 }
43
44 internal static void Send(SmtpConnection conn)
45 {
46 PrepareCommand(conn);
47 string response;
48 SmtpStatusCode statusCode = CheckCommand.Send(conn, out response);
49 CheckResponse(statusCode, response);
50 }
51}
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 IAsyncResult BeginSend(SmtpConnection conn, AsyncCallback callback, object state)
Definition DataCommand.cs:5
static void PrepareCommand(SmtpConnection conn)
static void EndSend(IAsyncResult result)
static void Send(SmtpConnection conn)
static void CheckResponse(SmtpStatusCode statusCode, string serverResponse)
static readonly byte[] Data
static string net_webstatus_ServerProtocolViolation
Definition SR.cs:152
static string SmtpDataStreamOpen
Definition SR.cs:154
Definition SR.cs:7