Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Internet
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Colaboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #7  
Antiguo 03-01-2023
IVAND IVAND is offline
Miembro
 
Registrado: may 2003
Ubicación: ECUADOR
Posts: 531
Poder: 24
IVAND Va por buen camino
Gracias por responder , si con la misma forma , uso delphi 2009 y los indy que vienen por defecto , uso el mismo codigo en delphi 11 y funciona sin problemas , parece que algo me falta en delphi 2009
Código Delphi [-]
procedure TForm1.Button2Click(Sender: TObject);
var smtp:TIdSMTP;
  mail:TIdMessage;
  Attachmentfile: TIdAttachmentFile;
begin
    smtp := TIdSMTP.Create(Self);
      Mail := TIdMessage.Create(Self);
      with smtp do
      begin

        Port:=465;
        Host:= 'smtp.gmail.com';
        Username:='[email protected]';
        Password:='hyzvtyccwttttt';  // 
        IOHandler:=SSLIOHandler;
        UseTLS := utUseExplicitTLS;
        AuthType:=satDefault ;
      end;

      SSLIOHandler.Port:= 465;
      SSLIOHandler.Host:= 'smtp.gmail.com';
      SSLIOHandler.Destination:='smtp.gmail.com:' + IntToStr(SSLIOHandler.Port);

      with mail do
      begin
        Recipients.Add;
        Recipients[0].Name   :='SitiSystems';
        Recipients.EmailAddresses:='[email protected]';
        From.Name            :='Integral ERP';
        From.Address         :='[email protected]';
        Subject              :='Se ha enviado un documento electronico';
        Body.Text:='Prueba de correo..revise adjunto'; // Es el texto del mensaje
        //ContentType := 'text / plain';
        CharSet      := 'utf-8';
        Encoding     := meMIME;
        Priority     := mpNormal;
        ContentType := 'multipart/mixed';
      end;
      Attachmentfile:=TIdAttachmentFile.Create(mail.MessageParts,'C:\Embajada\Ruc.pdf');
   //   Attachmentfile.FileName:='C:\Embajada\Ruc.pdf';
   //   Attachmentfile.ContentType := 'application/octet-stream';
   //   Attachmentfile.ContentID:='C:\Embajada\Ruc.pdf';
  //    Attachmentfile.DisplayName:='C:\Embajada\Ruc.pdf';
      try
        smtp.Connect;
      except
        ShowMessage('Ocurred an Error, The Message was not Sent');
      end;
        Screen.Cursor:=CrDefault;

      try
        smtp.Send(mail);
      except
      //on E: Exception do
        ShowMessage('The Message was not Sent');
      end;

      if smtp.Connected then
        smtp.Disconnect;
      mail.Free;
      smtp.Free;
end;

en uno funciona bien en otro no , que puede estar pasando , esperando sus consejos 
en 2009 envia el correo perfecto pero adjunta el archivo como noname y en delphi 11
__________________
IVAND
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
mail con ShellExecute y archivo adjunto MarioATamborini Internet 4 28-06-2007 00:39:20
Error al enviar mail con archivo adjunto cbothamley Internet 0 08-12-2006 04:56:45
Enviar adjunto por mail joel20 JAVA 3 10-07-2006 13:09:38
Enviar email con copia y adjunto con indy cmena Internet 4 01-10-2005 01:14:00
bajar adjunto de un mail zastilla Internet 0 22-06-2005 14:50:49


La franja horaria es GMT +2. Ahora son las 04:59:37.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi