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