SmtpStatusCode 열거형

정의

SmtpClient 클래스를 사용하여 이메일 전송 결과를 지정합니다.

public enum class SmtpStatusCode
public enum SmtpStatusCode
type SmtpStatusCode = 
Public Enum SmtpStatusCode
상속
SmtpStatusCode

필드

BadCommandSequence 503

명령이 잘못된 시퀀스로 전송되었습니다.

CannotVerifyUserWillAttemptDelivery 252

지정된 사용자가 로컬이 아니고 수신 SMTP 서비스가 메시지를 수락한 후 배달하려고 했습니다. 이 상태 코드는 https://www.ietf.org에서 사용할 수 있는 RFC 1123에 정의되어 있습니다.

ClientNotPermitted 454

클라이언트가 인증되지 않았거나 지정된 SMTP 호스트를 사용하여 메일을 보낼 수 없습니다.

CommandNotImplemented 502

SMTP 서비스가 지정된 명령을 구현하지 않습니다.

CommandParameterNotImplemented 504

SMTP 서비스가 지정된 명령 매개 변수를 구현하지 않습니다.

CommandUnrecognized 500

SMTP 서비스가 지정된 명령을 인식하지 못합니다.

ExceededStorageAllocation 552

메시지가 너무 커서 대상 사서함에 저장할 수 없습니다.

GeneralFailure -1

트랜잭션이 발생할 수 없습니다. 지정된 SMTP 호스트를 찾을 수 없는 경우 이 오류가 수신됩니다.

HelpMessage 214

도움말 메시지가 서비스에서 반환되었습니다.

InsufficientStorage 452

SMTP 서비스에 요청을 완료할 충분한 스토리지가 없습니다.

LocalErrorInProcessing 451

SMTP 서비스가 요청을 완료할 수 없습니다. 클라이언트의 IP 주소를 확인할 수 없는 경우(즉, 역방향 조회가 실패한 경우) 이 오류가 발생할 수 있습니다. 클라이언트 도메인이 오픈 릴레이 또는 원치 않는 이메일(스팸)에 대한 소스로 확인된 경우에도 이 오류가 발생할 수 있습니다. 자세한 내용은 https://www.ietf.org에서 사용할 수 있는 RFC 2505를 참조하세요.

MailboxBusy 450

대상 사서함이 사용 중입니다.

MailboxNameNotAllowed 553

대상 사서함을 지정하는 데 사용된 구문이 올바르지 않습니다.

MailboxUnavailable 550

대상 사서함을 찾을 수 없거나 액세스할 수 없습니다.

MustIssueStartTlsFirst 530

SMTP 서버는 TLS 연결만 허용하도록 구성되어 있고 SMTP 클라이언트는 TLS 이외의 연결을 사용하여 연결을 시도합니다. 해결 방법은 SMTP 클라이언트에서 EnableSsl=true를 설정하는 것입니다.

Ok 250

전자 메일이 SMTP 서비스로 전송되었습니다.

ServiceClosingTransmissionChannel 221

SMTP 서비스가 전송 채널을 닫는 중입니다.

ServiceNotAvailable 421

SMTP 서비스를 사용할 수 없으며 서버가 전송 채널을 닫는 중입니다.

ServiceReady 220

SMTP 서비스가 준비되었습니다.

StartMailInput 354

SMTP 서비스가 이메일 콘텐츠를 받을 준비가 되었습니다.

SyntaxError 501

명령 또는 매개 변수를 지정하는 데 사용되는 구문이 올바르지 않습니다.

SystemStatus 211

시스템 상태 또는 시스템 도움말 회신입니다.

TransactionFailed 554

트랜잭션이 실패했습니다.

UserNotLocalTryAlternatePath 551

사용자 사서함이 수신 서버에 있지 않습니다. 제공된 주소 정보를 사용하여 다시 전송해야 합니다.

UserNotLocalWillForward 251

사용자 사서함이 수신 서버에 있지 않으며 서버가 이메일을 전달합니다.

예제

다음 코드 예제에서는 콘솔에 오류 메시지를 표시 하면는 SmtpException throw 됩니다.

static void CreateMessageWithAttachment3( String^ server, String^ to )
{
   
   // Specify the file to be attached and sent.
   // This example assumes that a file named data.xls exists in the
   // current working directory.
   String^ file = L"data.xls";
   
   // Create a message and set up the recipients.
   MailMessage^ message = gcnew MailMessage( L"ReportMailer@contoso.com",to,L"Quarterly data report",L"See the attached spreadsheet." );
   
   // Create  the file attachment for this email message.
   Attachment^ data = gcnew Attachment("Qtr3.xls");
   
   
   // Add time stamp information for the file.
   ContentDisposition^ disposition = data->ContentDisposition;
   disposition->CreationDate = System::IO::File::GetCreationTime( file );
   disposition->ModificationDate = System::IO::File::GetLastWriteTime( file );
   disposition->ReadDate = System::IO::File::GetLastAccessTime( file );
   
   // Add the file attachment to this email message.
   message->Attachments->Add( data );
   
   //Send the message.
   SmtpClient^ client = gcnew SmtpClient( server );
   
   // Add credentials if the SMTP server requires them.
   client->Credentials = dynamic_cast<ICredentialsByHost^>(CredentialCache::DefaultNetworkCredentials);
   
   // Notify user if an error occurs.
   try
   {
      client->Send( message );
   }
   catch ( SmtpException^ e ) 
   {
      Console::WriteLine( L"Error: {0}", e->StatusCode );
   }
   finally
   {
      data->~Attachment();
      client->~SmtpClient();
   }

}
public static void CreateMessageWithAttachment3(string server, string to)
{
    // Specify the file to be attached and sent.
    // This example assumes that a file named Data.xls exists in the
    // current working directory.
    string file = "data.xls";
    // Create a message and set up the recipients.
    MailMessage message = new MailMessage(
       "ReportMailer@contoso.com",
       to,
       "Quarterly data report",
       "See the attached spreadsheet.");

    // Create  the file attachment for this email message.
    Attachment data = new Attachment("Qtr3.xls");
    // Add time stamp information for the file.
    ContentDisposition disposition = data.ContentDisposition;
    disposition.CreationDate = System.IO.File.GetCreationTime(file);
    disposition.ModificationDate = System.IO.File.GetLastWriteTime(file);
    disposition.ReadDate = System.IO.File.GetLastAccessTime(file);
    // Add the file attachment to this email message.
    message.Attachments.Add(data);
    //Send the message.
    SmtpClient client = new SmtpClient(server);
    // Add credentials if the SMTP server requires them.
    client.Credentials = (ICredentialsByHost)CredentialCache.DefaultNetworkCredentials;
    // Notify user if an error occurs.
    try
    {
        client.Send(message);
    }
    catch (SmtpException e)
    {
        Console.WriteLine("Error: {0}", e.StatusCode);
    }
    finally
    {
        data.Dispose();
    }
}

설명

값을 SmtpStatusCode SMTP Simple Mail Transfer Protocol () 서버에서 보낸 회신 상태 값을 지정 하는 열거형입니다. SmtpException 하 고 SmtpFailedRecipientsException 클래스를 포함할 StatusCode 반환 하는 속성 SmtpStatusCode 값입니다.

사용할 수 있는 RFC 2821에 정의 되어 있는 SMTP https://www.ietf.org합니다.

적용 대상