Próbuję wysłać pocztę E-mail z załącznikiem przez smtp.poczta.onet.pl z SSL - niestety bez powodzenia. Używam komponentów INDY 10 i DELPHI 7 Personal
Czy ktoś może mi pomóc ??
Zamieszczam kod z mojego programu:
IdMessage1.Body.Append('Dodane pliki:'); // PIERWSZY WIERSZ TREŚCI
IdMessage1.Body.Append(Copy(LogForm.ActLogBar.panels[0].text,29,Length(LogForm.ActLogBar.panels[0].text)-1)+'.CSV'); // DRUGI WIERSZ TREŚCI
IdMessage1.Body.Append(Copy(LogForm.ActLogBar.panels[0].text,29,Length(LogForm.ActLogBar.panels[0].text)-1)+'.ADI'); // TRZECI WIERSZ TREŚCI
IdMessage1.Recipients.EMailAddresses := Adresat.Text; // DO KOGO
IdMessage1.Subject := 'Zalacznik'; // TEMAT
IdMessage1. From.Address:=AdresEmail.Text; //OD KOGO
IdMessage1. From.Name:='Country'; // OD KOGO
idSMTP1.Password := Haslo.Text;
idSMTP1.Username := NazwaKonta.Text;
idSMTP1.Host := SerwerSMTP.Text;
idSMTP1.Port := StrToInt(PortSMTP.Text);
IdAttachment1 := TIdAttachmentFile.Create(IdMessage1.MessageParts, Copy(LogForm.ActLogBar.panels[0].text,29,Length(LogForm.ActLogBar.panels[0].text)-1)+'.CSV');
IdAttachment2 := TIdAttachmentFile.Create(IdMessage1.MessageParts, Copy(LogForm.ActLogBar.panels[0].text,29,Length(LogForm.ActLogBar.panels[0].text)-1)+'.ADI');
IdSMTP1.Connect;
try
IdSMTP1.Send(IdMessage1);
finally
IdAttachment1.Destroy;
IdAttachment2.Destroy;
IdSMTP1.Disconnect;