Hi!
I need to gather count of users of my program. I think, that good way for that are sending mail from my program to my mailbox. I want to have only number of users, not comp information or another crap.
But I have a little problem with that. I find a code for "secret" mail sending, but can`t translate this code to Lazarus:
program Project1;
{$APPTYPE CONSOLE}
uses IdSMTP, IdMessage;
{$R *.res}
var smtp : TIdSMTP;
msg : TIdMessage;
begin
smtp := TIdSMTP.Create(nil);
smtp.AuthenticationType := atLogin;
smtp.Username := 'from@mail.ru';
smtp.Password := 'ChangeMe';
smtp.Host := 'smtp.mail.ru';
smtp.Port := 25;
smtp.Connect;
if smtp.Authenticate then
begin
msg := TIdMessage.Create(nil);
msg.Subject := 'Subject';
msg.Body.Add('Mail body.');
msg.From.Text := 'president@whitehouse.gov';
msg.Recipients.EMailAddresses := 'to@yandex.ru';
smtp.Send(msg);
smtp.Disconnect;
msg.Free;
end;
smtp.Free;
end.
Help me, please.