Forum > Networking and Web Programming
Send mail for program`s statistic
Alex Cones:
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:
--- Code: ---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.
--- End code ---
Help me, please.
typo:
I think it is not a good idea.
Alex Cones:
Can you offer something better?
typo:
I'm sure you can think of something better.
Alex Cones:
I find a friend with a own server, who give me a counter page in php. For inc counter need to send user to page with counter.
Question : How to made it? User should not know about it.
Navigation
[0] Message Index
[#] Next page