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:='comcasanova2018sa@gmail.com';
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:='ivand2011@gmail.com';
From.Name :='Integral ERP';
From.Address :='comcasanova2018sa@gmail.com';
Subject :='Se ha enviado un documento electronico';
Body.Text:='Prueba de correo..revise adjunto'; CharSet := 'utf-8';
Encoding := meMIME;
Priority := mpNormal;
ContentType := 'multipart/mixed';
end;
Attachmentfile:=TIdAttachmentFile.Create(mail.MessageParts,'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
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