SmtpStatusCode Sabit listesi

Tanım

sınıfını kullanarak e-posta göndermenin SmtpClient sonucunu belirtir.

public enum class SmtpStatusCode
public enum SmtpStatusCode
type SmtpStatusCode = 
Public Enum SmtpStatusCode
Devralma
SmtpStatusCode

Alanlar

BadCommandSequence 503

Komutlar yanlış sırada gönderildi.

CannotVerifyUserWillAttemptDelivery 252

Belirtilen kullanıcı yerel değil, ancak alıcı SMTP hizmeti iletiyi kabul etti ve teslim etmeye çalıştı. Bu durum kodu, adresinde bulunan RFC 1123'te https://www.ietf.orgtanımlanır.

ClientNotPermitted 454

İstemcinin kimliği doğrulanmamış veya belirtilen SMTP ana bilgisayarını kullanarak posta göndermesine izin verilmiyor.

CommandNotImplemented 502

SMTP hizmeti belirtilen komutu uygulamaz.

CommandParameterNotImplemented 504

SMTP hizmeti belirtilen komut parametresini uygulamaz.

CommandUnrecognized 500

SMTP hizmeti belirtilen komutu tanımıyor.

ExceededStorageAllocation 552

İleti hedef posta kutusunda depolanamayacak kadar büyük.

GeneralFailure -1

İşlem gerçekleşemedi. Belirtilen SMTP konağı bulunamadığında bu hatayı alırsınız.

HelpMessage 214

Hizmet tarafından bir Yardım iletisi döndürüldü.

InsufficientStorage 452

SMTP hizmetinin isteği tamamlamak için yeterli depolama alanı yok.

LocalErrorInProcessing 451

SMTP hizmeti isteği tamamlayamıyor. İstemcinin IP adresi çözümlenemiyorsa (yani geriye doğru arama başarısız olduysa) bu hata oluşabilir. İstemci etki alanı istenmeyen e-posta (istenmeyen posta) için açık geçiş veya kaynak olarak tanımlandıysa da bu hatayı alabilirsiniz. Ayrıntılar için, adresinde bulunan RFC 2505 konusuna bakın https://www.ietf.org.

MailboxBusy 450

Hedef posta kutusu kullanımda.

MailboxNameNotAllowed 553

Hedef posta kutusunu belirtmek için kullanılan söz dizimi yanlış.

MailboxUnavailable 550

Hedef posta kutusu bulunamadı veya erişilemedi.

MustIssueStartTlsFirst 530

SMTP sunucusu yalnızca TLS bağlantılarını kabul etmek üzere yapılandırılmıştır ve SMTP istemcisi TLS olmayan bir bağlantı kullanarak bağlanmaya çalışır. Çözüm, kullanıcının SMTP İstemcisinde EnableSsl=true ayarını yapmasına yöneliktir.

Ok 250

E-posta SMTP hizmetine başarıyla gönderildi.

ServiceClosingTransmissionChannel 221

SMTP hizmeti iletim kanalını kapatıyor.

ServiceNotAvailable 421

SMTP hizmeti kullanılamıyor; sunucu iletim kanalını kapatıyor.

ServiceReady 220

SMTP hizmeti hazır.

StartMailInput 354

SMTP hizmeti e-posta içeriğini almaya hazır.

SyntaxError 501

Komut veya parametre belirtmek için kullanılan söz dizimi yanlış.

SystemStatus 211

Sistem durumu veya sistem Yardımı yanıtı.

TransactionFailed 554

İşlem başarısız oldu.

UserNotLocalTryAlternatePath 551

Kullanıcı posta kutusu alıcı sunucuda yer almıyor. Sağlanan adres bilgilerini kullanarak yeniden göndermeniz gerekir.

UserNotLocalWillForward 251

Kullanıcı posta kutusu alıcı sunucuda değil; sunucu e-postayı iletir.

Örnekler

Aşağıdaki kod örneği, bir oluştuğunda konsola bir SmtpException hata iletisi görüntüler.

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();
    }
}

Açıklamalar

Numaralandırmadaki SmtpStatusCode değerler, Basit Posta Aktarım Protokolü (SMTP) sunucusu tarafından gönderilen yanıt durumu değerlerini belirtir. SmtpException ve SmtpFailedRecipientsException sınıfları, değer döndüren SmtpStatusCode özellikler içerirStatusCode.

SMTP, adresinde bulunan RFC 2821'de https://www.ietf.orgtanımlanır.

Şunlara uygulanır