Sugerir traducción
 
Otros han sugerido:

progress indicator
No hay más sugerencias.
Evaluar y enviar comentarios
MSDN
MSDN Library
 SmtpStatusCode (Enumeración)
Contraer todo/Expandir todo Contraer todo
Ver contenido:  en paraleloVer contenido: en paralelo
.NET Framework Class Library
SmtpStatusCode Enumeration

Specifies the outcome of sending e-mail by using the SmtpClient class.

Namespace:  System.Net.Mail
Assembly:  System (in System.dll)
Visual Basic
Public Enumeration SmtpStatusCode
C#
public enum SmtpStatusCode
Visual C++
public enum class SmtpStatusCode
F#
type SmtpStatusCode
Member nameDescription
SystemStatusA system status or system Help reply.
HelpMessageA Help message was returned by the service.
ServiceReadyThe SMTP service is ready.
ServiceClosingTransmissionChannelThe SMTP service is closing the transmission channel.
OkThe email was successfully sent to the SMTP service.
UserNotLocalWillForwardThe user mailbox is not located on the receiving server; the server forwards the e-mail.
CannotVerifyUserWillAttemptDeliveryThe specified user is not local, but the receiving SMTP service accepted the message and attempted to deliver it. This status code is defined in RFC 1123, which is available at http://www.ietf.org.
StartMailInputThe SMTP service is ready to receive the e-mail content.
ServiceNotAvailableThe SMTP service is not available; the server is closing the transmission channel.
MailboxBusyThe destination mailbox is in use.
LocalErrorInProcessingThe SMTP service cannot complete the request. This error can occur if the client's IP address cannot be resolved (that is, a reverse lookup failed). You can also receive this error if the client domain has been identified as an open relay or source for unsolicited e-mail (spam). For details, see RFC 2505, which is available at http://www.ietf.org.
InsufficientStorageThe SMTP service does not have sufficient storage to complete the request.
ClientNotPermittedThe client was not authenticated or is not allowed to send mail using the specified SMTP host.
CommandUnrecognizedThe SMTP service does not recognize the specified command.
SyntaxErrorThe syntax used to specify a command or parameter is incorrect.
CommandNotImplementedThe SMTP service does not implement the specified command.
BadCommandSequenceThe commands were sent in the incorrect sequence.
MustIssueStartTlsFirstThe SMTP server is configured to accept only TLS connections, and the SMTP client is attempting to connect by using a non-TLS connection. The solution is for the user to set EnableSsl=true on the SMTP Client.
CommandParameterNotImplementedThe SMTP service does not implement the specified command parameter.
MailboxUnavailableThe destination mailbox was not found or could not be accessed.
UserNotLocalTryAlternatePathThe user mailbox is not located on the receiving server. You should resend using the supplied address information.
ExceededStorageAllocationThe message is too large to be stored in the destination mailbox.
MailboxNameNotAllowedThe syntax used to specify the destination mailbox is incorrect.
TransactionFailedThe transaction failed.
GeneralFailureThe transaction could not occur. You receive this error when the specified SMTP host cannot be found.

The values in the SmtpStatusCode enumeration specify reply status values sent by a Simple Mail Transfer Protocol (SMTP) server. The SmtpException and SmtpFailedRecipientsException classes contain StatusCode properties that return SmtpStatusCode values.

SMTP is defined in RFC 2821 available at http://www.ietf.org.

The following code example displays an error message to the console when an SmtpException is thrown.

C#
        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 e-mail 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 e-mail 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();
            }
        }
Visual C++
   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 e-mail 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 e-mail 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();
      }

   }


.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role not supported), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Biblioteca de clases de .NET Framework
SmtpStatusCode (Enumeración)

Especifica el resultado de enviar correo electrónico utilizando la clase SmtpClient.

Espacio de nombres:  System.Net.Mail
Ensamblado:  System (en System.dll)
Visual Basic
Public Enumeration SmtpStatusCode
C#
public enum SmtpStatusCode
Visual C++
public enum class SmtpStatusCode
F#
type SmtpStatusCode
Nombre de miembroDescripción
SystemStatusEstado del sistema o respuesta de ayuda del sistema.
HelpMessageEl servicio devolvió un mensaje de ayuda.
ServiceReadyEl servicio SMTP está listo.
ServiceClosingTransmissionChannelEl servicio SMTP está cerrando el canal de transmisión.
OkEl mensaje de correo electrónico se ha enviado correctamente al servicio SMTP.
UserNotLocalWillForwardNo se ha encontrado el buzón del usuario en el servidor receptor; el servidor reenvía el correo electrónico.
CannotVerifyUserWillAttemptDeliveryEl usuario especificado no es local, pero el servicio SMTP receptor aceptó el mensaje e intentó entregarlo. Este código de estado se define en el documento RFC 1123, que está disponible en http://www.ietf.org.
StartMailInputEl servicio SMTP está listo para recibir el contenido del correo electrónico.
ServiceNotAvailableEl servicio SMTP no está disponible; el servidor está cerrando el canal de transmisión.
MailboxBusyEl buzón de destino se está utilizando en estos momentos.
LocalErrorInProcessingEl servicio SMTP no puede completar la solicitud. Este error puede producirse si la dirección IP del cliente no puede resolverse (es decir, si una búsqueda inversa produjo un error). También puede recibir este error si el dominio del cliente se ha identificado como una retransmisión abierta u origen para el correo electrónico no solicitado (spam). Para obtener información detallada, vea el documento RFC 2505, que está disponible en http://www.ietf.org.
InsufficientStorageEl servicio SMTP no dispone de suficiente espacio de almacenamiento como para completar la solicitud.
ClientNotPermittedNo se ha autenticado el cliente o no tiene permiso para enviar correo utilizando el host SMTP especificado.
CommandUnrecognizedEl servicio SMTP no reconoce el comando especificado.
SyntaxErrorLa sintaxis utilizada para especificar un comando o parámetro es incorrecta.
CommandNotImplementedEl servicio SMTP no implementa el comando especificado.
BadCommandSequenceLos comandos se enviaron en la secuencia incorrecta.
MustIssueStartTlsFirstEl servidor SMTP está configurado para aceptar únicamente conexiones TLS y el cliente SMTP está intentando conectarse utilizando una conexión que no es TLS. Para solucionarlo, el usuario deberá establecer EnableSsl=true en el cliente SMTP.
CommandParameterNotImplementedEl servicio SMTP no implementa el parámetro de comando especificado.
MailboxUnavailableNo se ha encontrado el buzón de destino o no se ha podido obtener acceso al mismo.
UserNotLocalTryAlternatePathNo se ha encontrado el buzón del usuario en el servidor receptor. Debería reenviar el correo utilizando la información de dirección suministrada.
ExceededStorageAllocationEl mensaje es demasiado grande para almacenarse en el buzón de destino.
MailboxNameNotAllowedLa sintaxis utilizada para especificar el buzón de destino es incorrecta.
TransactionFailedSe ha producido un error en la transacción.
GeneralFailureNo se ha podido llevar a cabo la transacción. Se recibe este error cuando no se puede encontrar el host SMTP especificado.

Los valores de la enumeración SmtpStatusCode especifican valores de estado de respuesta enviados por un servidor SMTP (Protocolo simple de transferencia de correo). Las clases SmtpException y SmtpFailedRecipientsException contienen propiedades StatusCode que devuelven valores de SmtpStatusCode.

El protocolo SMTP se define en el documento RFC 2821, que está disponible en http://www.ietf.org.

En el siguiente ejemplo de código se muestra un mensaje de error en la consola cuando se produce una excepción SmtpException.

C#
        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 e-mail 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 e-mail 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();
            }
        }
Visual C++
   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 e-mail 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 e-mail 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();
      }

   }


.NET Framework

Compatible con: 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Compatible con: 4, 3.5 SP1

Windows 7, Windows Vista SP1 o posterior, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (no se admite Server Core), Windows Server 2008 R2 (se admite Server Core con SP1 o posterior), Windows Server 2003 SP2

.NET Framework no admite todas las versiones de todas las plataformas. Para obtener una lista de las versiones compatibles, vea Requisitos de sistema de .NET Framework.
Contenido de la comunidad   ¿Qué es Community Content?
Agregar contenido nuevo RSS  Anotaciones
Processing
© 2012 Microsoft. Reservados todos los derechos. Términos de uso | Marcas Registradas | Privacidad
Page view tracker