TransferEncoding Enumeração
Definição
Especifica as informações do cabeçalho Content-Transfer-Encoding para um anexo de mensagem de email.Specifies the Content-Transfer-Encoding header information for an email message attachment.
public enum class TransferEncoding
public enum TransferEncoding
type TransferEncoding =
Public Enum TransferEncoding
- Herança
Campos
| Base64 | 1 | Codifica dados baseados em fluxo.Encodes stream-based data. Consulte a seção 6.8 do RFC 2406.See RFC 2406 Section 6.8. |
| EightBit | 3 | Os dados estão em caracteres de 8 bits que podem representar caracteres internacionais com um comprimento total de linha de até mil caracteres de 8 bits.The data is in 8-bit characters that may represent international characters with a total line length of no longer than 1000 8-bit characters. Para obter mais informações sobre essa extensão de transporte MIME de 8 bits, consulte IETF RFC 6152.For more information about this 8-bit MIME transport extension, see IETF RFC 6152. |
| QuotedPrintable | 0 | Codifica os dados que consistem em caracteres imprimíveis no conjunto de caracteres US-ASCII.Encodes data that consists of printable characters in the US-ASCII character set. Consulte a seção 6.7 do RFC 2406.See RFC 2406 Section 6.7. |
| SevenBit | 2 | Usado para dados que não estão codificados.Used for data that is not encoded. Os dados estão em caracteres US-ASCII de 7 bits com um comprimento total de linha de até mil caracteres.The data is in 7-bit US-ASCII characters with a total line length of no longer than 1000 characters. Consulte a seção 2.7 do RFC2406.See RFC2406 Section 2.7. |
| Unknown | -1 | Indica que a codificação de transferência é desconhecida.Indicates that the transfer encoding is unknown. |
Exemplos
O exemplo de código a seguir exibe o TransferEncoding usado por um anexo.The following code example displays TransferEncoding used by an attachment.
static void DisplayStreamAttachment( Attachment^ a )
{
Stream^ s = a->ContentStream;
StreamReader^ reader = gcnew StreamReader( s );
Console::WriteLine( L"Content: {0}", reader->ReadToEnd() );
Console::WriteLine( L"Content Type {0}", a->ContentType );
Console::WriteLine( L"Transfer Encoding {0}", a->TransferEncoding );
// Note that you cannot close the reader before the email is sent.
// Closing the reader before sending the email will close the
// ContentStream and cause an SmtpException.
reader = nullptr;
}
public static void DisplayStreamAttachment(Attachment a)
{
Stream s = a.ContentStream;
StreamReader reader = new StreamReader(s);
Console.WriteLine("Content: {0}", reader.ReadToEnd());
Console.WriteLine("Content Type {0}", a.ContentType.ToString());
Console.WriteLine("Transfer Encoding {0}", a.TransferEncoding);
// Note that you cannot close the reader before the email is sent.
// Closing the reader before sending the email will close the
// ContentStream and cause an SmtpException.
reader = null;
}
Comentários
Os valores na TransferEncoding enumeração são usados com a AttachmentBase.TransferEncoding propriedade.The values in the TransferEncoding enumeration are used with the AttachmentBase.TransferEncoding property.
O cabeçalho de codificação de transferência de conteúdo especifica a codificação do corpo da mensagem associada para que ele atenda aos requisitos de SMTP.The Content-Transfer-Encoding header specifies the encoding of the associated message body so that it meets SMTP requirements. O SMTP exige que os dados para transporte estejam em caracteres US-ASCII de 7 bits com linhas com até 1000 caracteres.SMTP requires data for transport to be in 7-bit US-ASCII characters with lines no longer than 1000 characters.
Os valores de codificação de transferência de conteúdo são descritos detalhadamente no RFC 2045 seção 6, disponível em https://www.ietf.org .Content-Transfer-Encoding values are described in detail in RFC 2045 Section 6, available at https://www.ietf.org.