lua_rj Aprendiz

Registrado: Quarta-Feira, 4 de Janeiro de 2006 Mensagens: 100
|
Enviada: Sex Set 06, 2019 2:52 pm Assunto: Envio de email - Não enviando anexo |
|
|
Boa tarde! Estou tentando enviar anexo na função de email, mas ele não está anexando..
O email chega desta forma:
This is a multi-part message in MIME format --fPFxywPtcoA6EfRzE4Y=_cskVFtaaK9PAC Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline TESTE DE ENVIO --fPFxywPtcoA6EfRzE4Y=_cskVFtaaK9PAC Content-Type: text/plain; name="2.txt" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="2.txt" ZnJtQ2FkVGlwb0RDTVQ= --fPFxywPtcoA6EfRzE4Y=_cskVFtaaK9PAC--
Com esse texto ai. Se eu não anexar nada ele enviar e no corpo fica só o texto de teste. Tem mais alguma configuração que precisa ser feito?
O codigo para anexar é esse :
if Email.ArqEmAnexo.Count > 0 then
begin
for I := 0 to Email.ArqEmAnexo.Count - 1 do
begin
ArqAux := ExtractFileName(Email.ArqEmAnexo.Strings[I]);
if Email.HtmlBody and ArquivoDeImagem(ArqAux) then
begin
anexo := TIdAttachment.Create(IdMessage.MessageParts);//, Email.ArqEmAnexo.Strings[I]);
anexo.ContentDisposition := 'inline';
anexo.ExtraHeaders.Values['Content-ID'] := '<' + ArqAux + '>';
anexo.DisplayName := ArqAux;
end
else
begin
if pdfFile then
begin
anexo:= TIdAttachmentFile.Create(IdMessage.MessageParts, Email.ArqEmAnexo.Strings[I]);
anexo.ContentType := 'application/pdf;';
anexo.FileName := ExtractFileName(ArqAux);
end
else
begin
//anexo := TIdAttachment.Create(IdMessage.MessageParts);
anexo:= TIdAttachmentFile.Create(IdMessage.MessageParts, Email.ArqEmAnexo.Strings[I]);
anexo.ContentDisposition := 'attachment';
//anexo.FileName := ExtractFileName(ArqAux);
end;
end;
end;
end; _________________ Obrigada pela atenção!
Gisele Gonçalves |
|