SmtpStatusCode SmtpStatusCode SmtpStatusCode SmtpStatusCode Enum

Definición

Especifica el resultado del envío de correo electrónico con la clase SmtpClient.Specifies the outcome of sending email by using the SmtpClient class.

public enum class SmtpStatusCode
public enum SmtpStatusCode
type SmtpStatusCode = 
Public Enum SmtpStatusCode
Herencia
SmtpStatusCodeSmtpStatusCodeSmtpStatusCodeSmtpStatusCode

Campos

BadCommandSequence BadCommandSequence BadCommandSequence BadCommandSequence 503

Los comandos se enviaron en la secuencia incorrecta.The commands were sent in the incorrect sequence.

CannotVerifyUserWillAttemptDelivery CannotVerifyUserWillAttemptDelivery CannotVerifyUserWillAttemptDelivery CannotVerifyUserWillAttemptDelivery 252

El usuario especificado no es local, pero el servicio SMTP receptor aceptó el mensaje e intentó entregarlo.The specified user is not local, but the receiving SMTP service accepted the message and attempted to deliver it. Este código de estado se define en RFC 1123, que está disponible en https://www.ietf.org.This status code is defined in RFC 1123, which is available at https://www.ietf.org.

ClientNotPermitted ClientNotPermitted ClientNotPermitted ClientNotPermitted 454

El cliente no se ha autenticado o no tiene permiso para enviar correo mediante el host SMTP especificado.The client was not authenticated or is not allowed to send mail using the specified SMTP host.

CommandNotImplemented CommandNotImplemented CommandNotImplemented CommandNotImplemented 502

El servicio SMTP no implementa el comando especificado.The SMTP service does not implement the specified command.

CommandParameterNotImplemented CommandParameterNotImplemented CommandParameterNotImplemented CommandParameterNotImplemented 504

El servicio SMTP no implementa el parámetro de comando especificado.The SMTP service does not implement the specified command parameter.

CommandUnrecognized CommandUnrecognized CommandUnrecognized CommandUnrecognized 500

El servicio SMTP no reconoce el comando especificado.The SMTP service does not recognize the specified command.

ExceededStorageAllocation ExceededStorageAllocation ExceededStorageAllocation ExceededStorageAllocation 552

El mensaje es demasiado grande para almacenarse en el buzón de destino.The message is too large to be stored in the destination mailbox.

GeneralFailure GeneralFailure GeneralFailure GeneralFailure -1

La transacción no puedo tener lugar.The transaction could not occur. Recibirá este error cuando no se pueda encontrar el host SMTP especificado.You receive this error when the specified SMTP host cannot be found.

HelpMessage HelpMessage HelpMessage HelpMessage 214

El servicio devolvió un mensaje de ayuda.A Help message was returned by the service.

InsufficientStorage InsufficientStorage InsufficientStorage InsufficientStorage 452

El servicio SMTP no tiene almacenamiento suficiente para completar la solicitud.The SMTP service does not have sufficient storage to complete the request.

LocalErrorInProcessing LocalErrorInProcessing LocalErrorInProcessing LocalErrorInProcessing 451

El servicio SMTP no puede completar la solicitud.The SMTP service cannot complete the request. Este error puede producirse si la dirección IP del cliente no se puede resolver (es decir, no se pudo realizar una búsqueda inversa).This error can occur if the client's IP address cannot be resolved (that is, a reverse lookup failed). También puede recibir este error si el dominio del cliente se ha identificado como un origen o retransmisión abierta para el correo no deseado.You can also receive this error if the client domain has been identified as an open relay or source for unsolicited email (spam). Para más información, vea la sección RFC 2505, disponible en https://www.ietf.org.For details, see RFC 2505, which is available at https://www.ietf.org.

MailboxBusy MailboxBusy MailboxBusy MailboxBusy 450

El buzón de destino está en uso.The destination mailbox is in use.

MailboxNameNotAllowed MailboxNameNotAllowed MailboxNameNotAllowed MailboxNameNotAllowed 553

La sintaxis utilizada para especificar el buzón de destino es incorrecta.The syntax used to specify the destination mailbox is incorrect.

MailboxUnavailable MailboxUnavailable MailboxUnavailable MailboxUnavailable 550

El buzón de destino no se encontró o no se pudo acceder a él.The destination mailbox was not found or could not be accessed.

MustIssueStartTlsFirst MustIssueStartTlsFirst MustIssueStartTlsFirst MustIssueStartTlsFirst 530

El servidor SMTP está configurado para aceptar únicamente conexiones TLS y el cliente SMTP está intentando conectarse mediante una conexión que no es TLS.The SMTP server is configured to accept only TLS connections, and the SMTP client is attempting to connect by using a non-TLS connection. La solución es para que el usuario establezca EnableSsl=true en el cliente de SMTP.The solution is for the user to set EnableSsl=true on the SMTP Client.

Ok Ok Ok Ok 250

El correo electrónico se envió correctamente con el servicio SMTP.The email was successfully sent to the SMTP service.

ServiceClosingTransmissionChannel ServiceClosingTransmissionChannel ServiceClosingTransmissionChannel ServiceClosingTransmissionChannel 221

El servicio SMTP está cerrando el canal de transmisión.The SMTP service is closing the transmission channel.

ServiceNotAvailable ServiceNotAvailable ServiceNotAvailable ServiceNotAvailable 421

El servicio SMTP no está disponible; el servidor está cerrando el canal de transmisión.The SMTP service is not available; the server is closing the transmission channel.

ServiceReady ServiceReady ServiceReady ServiceReady 220

El servicio SMTP está listo.The SMTP service is ready.

StartMailInput StartMailInput StartMailInput StartMailInput 354

El servicio SMTP está listo para recibir el contenido de correo electrónico.The SMTP service is ready to receive the email content.

SyntaxError SyntaxError SyntaxError SyntaxError 501

La sintaxis utilizada para especificar un comando o parámetro es incorrecta.The syntax used to specify a command or parameter is incorrect.

SystemStatus SystemStatus SystemStatus SystemStatus 211

Estado del sistema o respuesta de ayuda del sistema.A system status or system Help reply.

TransactionFailed TransactionFailed TransactionFailed TransactionFailed 554

Error en la transacción.The transaction failed.

UserNotLocalTryAlternatePath UserNotLocalTryAlternatePath UserNotLocalTryAlternatePath UserNotLocalTryAlternatePath 551

No se encuentra el buzón del usuario en el servidor receptor.The user mailbox is not located on the receiving server. Debería realizar el reenvío utilizando la información de dirección suministrada.You should resend using the supplied address information.

UserNotLocalWillForward UserNotLocalWillForward UserNotLocalWillForward UserNotLocalWillForward 251

El buzón de usuario no se encuentra en el servidor de recepción; el servidor reenvía el correo electrónico.The user mailbox is not located on the receiving server; the server forwards the email.

Ejemplos

En el ejemplo de código siguiente se muestra un mensaje de error en la consola cuando un SmtpException se produce.The following code example displays an error message to the console when an SmtpException is thrown.

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

Comentarios

Los valores de la SmtpStatusCode enumeración especifica valores de estado de respuesta enviados por un servidor de Protocolo Simple de transferencia de correo (SMTP).The values in the SmtpStatusCode enumeration specify reply status values sent by a Simple Mail Transfer Protocol (SMTP) server. El SmtpException y SmtpFailedRecipientsException contienen clases StatusCode propiedades que devuelven SmtpStatusCode valores.The SmtpException and SmtpFailedRecipientsException classes contain StatusCode properties that return SmtpStatusCode values.

SMTP se define en RFC 2821 disponible en https://www.ietf.org .SMTP is defined in RFC 2821 available at https://www.ietf.org.

Se aplica a