MailAttachment
Os objetos Attachment permitem fazer referência a arquivos em um objeto Email
. Os objetos Attachment são criados usando o comando MAIL New attachment
.
Objeto anexos
Objetos anexos oferecem as propriedades e funções apenas leitura abaixo:
.cid : Text |
.disposition : Text o valor do cabeçalho `Content-Disposition |
.getContent() : 4D.Blob returns the contents of the attachment object in a 4D.Blob object |
.name : Text o nome e a extensão do anexo |
.path : Text o caminho POSIX do arquivo de anexo, se ele existir |
.platformPath : Text the path of the attachment file expressed with the current platform syntax |
.size : Integer the value of the size header of the attachment file |
.type : Text o content-type do arquivo anexo |
4D. MailAttachment.new()
História
Release | Mudanças |
---|---|
19 R2 | Accepts 4D. File, 4D. ZipFile, 4D. Blob |
4D.MailAttachment.new( file : 4D.File { ; name : Text {; cid : Text{ ; type : Text { ; disposition :Text } } } } ) : 4D.MailAttachment
4D.MailAttachment.new( zipFile : 4D.ZipFile { ; name : Text {; cid : Text{ ; type : Text { ; disposition :Text } } } } ) : 4D.MailAttachment
4D.MailAttachment.new( blob : 4D.Blob { ; name : Text {; cid : Text{ ; type : Text { ; disposition :Text } } } } ) : 4D.MailAttachment
4D.MailAttachment.new( path : Text { ; name : Text {; cid : Text{ ; type : Text { ; disposition :Text } } } } ) : 4D.MailAttachment
Parâmetro | Tipo | Descrição | |
---|---|---|---|
file | 4D. File | -> | Parâmetros |
zipFile | 4D. ZipFile | -> | Arquivo zip |
blob | 4D. Blob | -> | Blob contendo o anexo |
path | Text | -> | Pode passar uma rota ou um Blob para definir o anexo. |
name | Text | -> | Nome + extensão usado pelo cliente email para designar o anexo |
cid | Text | -> | ID do anexo (apenas mensagens HTML), ou " " se nenhum cid for exigido |
type | Text | -> | Valor do cabeçalho content-type |
disposition | Text | -> | Valor do cabeçalho content-disposition: "inline" ou "attachment". |
Resultados | 4D. MailAttachment | <- | Objeto anexo |
Descrição
The 4D.MailAttachment.new()
function creates and returns a new object of the 4D.MailAttachment
type. Ele é idêntico ao comando MAIL New attachment
(atalho).
.cid
.cid : Text
Descrição
A propriedade .cid
contém o ID do anexo. Essa funcionalidade é usada em mensagens HTML apenas. Se essa propriedade faltar, o arquivo é manejado como um anexo simples (link).
.disposition
.disposition : Text
Descrição
A propriedade .disposition
contém o valor do cabeçalho `Content-Disposition. Dois valores esetão disponíveis:
- "inline": o anexo é renderizado dentro dos conteúdos da mensagem, no local "cid". A renderização depende do cliente mail.
- "attachment": o anexo é fornecido como um link na mensagem.
.getContent()
.getContent() : 4D.Blob
Parâmetro | Tipo | Descrição | |
---|---|---|---|
Resultados | 4D. Blob | <- | Conteúdo do anexo |
Descrição
The .getContent()
function returns the contents of the attachment object in a 4D.Blob
object. Você pode usar esse método com objetos de anexo recebidos pelo comando MAIL Convert from MIME
.
.name
.name : Text
Descrição
A propriedade .name
contém o nome e a extensão do anexo. By default, it is the name of the file, unless another name was specified in the MAIL New attachment
command.
.path
.path : Text
Descrição
A propriedade .path
contém o caminho POSIX do arquivo de anexo, se ele existir.
.platformPath
História
Release | Mudanças |
---|---|
19 | Adicionado |
.platformPath : Text
Descrição
The .platformPath
property returns the path of the attachment file expressed with the current platform syntax.
.size
.size : Integer
Descrição
The .size
property contains the value of the size
header of the attachment file. The .size
property is returned when the MIME message defines a size header in the attachment part.
.type
.type : Text
Descrição
A propriedade .type
contém o content-type
do arquivo anexo. If this type is not explicitly passed to the MAIL New attachment
command, the content-type
is based on its file extension.