Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2012-12

HTTP and POP3 client components

15 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael Schnell

Hi,

Sorry for being a nuisance again :-[ ....

We need to do a command line program to run n Linux (PC, later ARM), that reads a mail via POP3 and then does some communication towards some HTTP server (reading some pages and setting a value with some cgi program running there.)

I do know that decent HTTP and POP3 components are available with Indy, but I am afraid of trying to use Indy on Lazarus/ARM/Linux.

As we already successfully did an FTP client program on Lazarus with lnet, I decided to try to use lnet, here again.

So I installed the latest lnet package and found that in fact a HTTP client component is available.

Up till now, I failed to find a decent documentation, so I was not able to read a page from a web server (in fact I would need a proxy for some environments, but - at least on Linux - I suppose there is a system wide proxy definition that might automatically apply.

In fact "connect" seems to work, but what now ?....

Seemingly lnet does not provide a POP3 client component out of the box. So what to do ?

Thanks for any pointers,
-Michael

Reply by email

Stephane Carre
to Michael Schnell

Did you have look at synapse ? http://synapse.ararat.cz/doku.php Works fine under Linux and Windows, 32 and 64 bit, both with Lazarus and Delphi. Stephane

Earlier message 38 lines
----- Original Message ----- From: "Michael Schnell" To: "Lazarus mailing list" Sent: Monday, 3 December, 2012 11:59:34 AM Subject: [Lazarus] HTTP and POP3 client components Hi, Sorry for being a nuisance again :-[ .... We need to do a command line program to run n Linux (PC, later ARM), that reads a mail via POP3 and then does some communication towards some HTTP server (reading some pages and setting a value with some cgi program running there.) I do know that decent HTTP and POP3 components are available with Indy, but I am afraid of trying to use Indy on Lazarus/ARM/Linux. As we already successfully did an FTP client program on Lazarus with lnet, I decided to try to use lnet, here again. So I installed the latest lnet package and found that in fact a HTTP client component is available. Up till now, I failed to find a decent documentation, so I was not able to read a page from a web server (in fact I would need a proxy for some environments, but - at least on Linux - I suppose there is a system wide proxy definition that might automatically apply. In fact "connect" seems to work, but what now ?.... Seemingly lnet does not provide a POP3 client component out of the box. So what to do ? Thanks for any pointers, -Michael --

Reply by email

Antonio Fortuny
to Michael Schnell: Sorry for being a nuisance again :-[ .... We need to do a command line program to run n…

Le 03/12/2012 11:59, Michael Schnell a ?crit :

Show quoted text 11 lines
Hi, Sorry for being a nuisance again :-[ .... We need to do a command line program to run n Linux (PC, later ARM), that reads a mail via POP3 and then does some communication towards some HTTP server (reading some pages and setting a value with some cgi program running there.) I do know that decent HTTP and POP3 components are available with Indy, but I am afraid of trying to use Indy on Lazarus/ARM/Linux.

I currently use Indy 10 (10.5.8) successfully with Win32-Win64-WinCE(Arm)-Linux64 with Lazarus (1.1) and Delphi (5, 2007), all platforms talking to each other over TCP/IP. Pretty simple to use (a little more difficult to compile for Lazarus)
Blocking sockets with timeouts

Show quoted text 26 lines
As we already successfully did an FTP client program on Lazarus with lnet, I decided to try to use lnet, here again. So I installed the latest lnet package and found that in fact a HTTP client component is available. Up till now, I failed to find a decent documentation, so I was not able to read a page from a web server (in fact I would need a proxy for some environments, but - at least on Linux - I suppose there is a system wide proxy definition that might automatically apply. In fact "connect" seems to work, but what now ?.... Seemingly lnet does not provide a POP3 client component out of the box. So what to do ? Thanks for any pointers, -Michael -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Michael Schnell
to Michael Schnell
Michael Schnell wrote
Up til now I failed to find in the docs if/how I can do a http client.

It seems that "THTTPSend" is supplied for this purpose (no Idea why it is not called "THTTPClient".

In Fact "THTTPSend" even has published properties, so it seems that it can be installed as a visual component.

Is there a package file that allows for doing this ?

-Michael

Reply by email

Unknown author
to Michael Schnell
Michael Schnell wrote 6 lines
More talk to myself... It does install but when installing it the IDE says it has no "register", thus no visual components are created. But it does have "published" properties.... ?!?!?!

Search for synapse visual packages.

The synapse classes are not visual. There is a package that has visual counterparts.

That said, the advantage of having these classes visual is nearly non-existent.

Michael.

Reply by email

Michael Schnell
to Unknown author
That said, the advantage of having these classes visual is nearly non-existent.

Yep. But it shows what the user is supposed to access (very useful when he did not (yet) find the appropriate docu or example)

In fact I rather easily did get it working.

(If someone involved in the project reads this thread: a small complaint: it does not seem to do a DNS resolving for the proxy: I needed to give the IP address instead of the name.)

-Michael

Reply by email

Unknown author
to Michael Schnell
Michael Schnell wrote 6 lines
On 12/05/2012 12:38 PM, wrote: > That said, the advantage of having these classes visual is nearly > non-existent. Yep. But it shows what the user is supposed to access (very useful when he did not (yet) find the appropriate docu or example)

Code completion ?
There are lots of comments, so the IDE should give you hints.

In fact I rather easily did get it working.

QED :-)

Michael.

Reply by email

waldo kitty
to Michael Schnell: Great. I d/lded the sources (snapshot). Up til now I failed to find in the docs if/how I…
Michael Schnell wrote 10 lines
On 12/03/2012 12:24 PM, Stephane Carre wrote: > Did you have look at synapse ? http://synapse.ararat.cz/doku.php > Works fine under Linux and Windows, 32 and 64 bit, both with Lazarus and Delphi. Great. I d/lded the sources (snapshot). Up til now I failed to find in the docs if/how I can do a http client. Thanks for any pointers.

i've started with the testhttp.pas in the demos/fpc directory from the synapse release archive... then i have also pulled the vcs stuff to use... the demos are not included in the vcs...

FWIW: the testhttp works fine for the most part as simple as it is... one can also easily enable it for https connections with the openssl dlls by adding one unit to the uses clause... but synapse is apparently also only supported on winwhatever and linux... i'm aiming for the OS/2 target with help but there are still some problems and seemingly no support is forthcoming from the synapse folks on their list... at least, i've not seen any at all in regards to my and another's postings there :? one person did respond to my first post with a pointer to getting errorcodes... i thanked them there and will do so again here because they participate in both of these areas... so thanks, once again, ludo... it helped but we haven't gotten much further yet :?

Reply by email

waldo kitty
to Michael Schnell: It seems that "THTTPSend" is supplied for this purpose (no Idea why it is not called…
Michael Schnell wrote 12 lines
On 12/05/2012 11:21 AM, Michael Schnell wrote: > > > Up til now I failed to find in the docs if/how I can do a http client. It seems that "THTTPSend" is supplied for this purpose (no Idea why it is not called "THTTPClient". In Fact "THTTPSend" even has published properties, so it seems that it can be installed as a visual component. Is there a package file that allows for doing this ?

there is a lpk file in the synapse vcs files, yes...

Reply by email

waldo kitty
to Michael Schnell
Michael Schnell wrote
Thanks, HTTP client works nicely right now (doing "GET").

yup and doing https is just as easy if the site supports https, that is...

Next on the to-try list is sending button-press, edit-field etc, but I suppose this is just a matter of setting up the appropriate URL string.

that and getting the method right... on some sites you can use GET with parameters in the URL but POST doesn't go that way... some sites will take either POST or GET for submitting data but others will only take POST...

After this I will try to receive a Mail using the POP3 client.

good luck! ;)

Reply by email