Witam.
Posiadam problem z INDY.
Oto kod:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, IdAntiFreezeBase, IdAntiFreeze, IdMessage, IdBaseComponent,
IdComponent, IdTCPConnection, IdTCPClient, IdMessageClient, IdSMTP,
StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
IdSMTP1: TIdSMTP;
IdMessage1: TIdMessage;
IdAntiFreeze1: TIdAntiFreeze;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
IdMessage1.Body.Append('TRESC MAILA');
IdMessage1.Recipients.EMailAddresses := '@gmail.com';
IdMessage1.Subject := 'TEMAT';
IdMessage1.From.Name := 'NAZWA NADAWCY';
IdMessage1.From.Address := '[email protected]';
idSMTP1.Password := '';
idSMTP1.Username := '';
idSMTP1.Host := 'smtp.wp.pl'; // zostaw
TIdAttachment.Create(IdMessage1.MessageParts, 'd:\lol.txt');
IdSMTP1.Connect;
try
IdSMTP1.Send(IdMessage1);
finally
IdSMTP1.Disconnect;
end;
end;
end.
Hasło, login itp rzecz jasna było wpisane. Z powodów oczywistych usunąłem to teraz.
Error jaki mi wyskakuje gdy naciskam na button:
Jeżeli chodzi o e-maila na wp to zaznaczyłem opcję: Zezwalaj na dostęp do poczty za pomocą protokołu POP3/IMAP/SMTP.
Nie wiem w czym może być problem xd Może mam pobrane jakieś felerne komponenty INDY.
Proszę o pomoc.