Hi,
Is it possible to read and send mails from Exchange Server? Is there any example for it?
Thanks in advance.
Hakan ONEMLI
Harbour & MSVC 2022 & FWH 23.06
Hi,
Is it possible to read and send mails from Exchange Server? Is there any example for it?
Thanks in advance.
Thanks Anser,
This example is related sending mails. Is there any examples that reading mails?
Hi Hakan,
Sorry, I don't have any samples to demonstrate retrieval of email messages from a POP3 server. I have not tried this till now.
I think MAPI is the way to go for reading mails and CDO is used mostly for sending mails.
Regards
Anser
oSession:=CreateObject("MSMAPI.MAPISession")Anser,
Have you tried searching the forum for "POP3?" I seem to remember there was some sample code for this.
James
Dear Mr.James,
I tried the followinng link in the spanish forum, but unfortunately I could not get it work.
As per the link, you need to download an OCX file named MSMAPI32.OCX. But even after registering the OCX, the program crashes. If you check the Valtype of the object created, instead of Object, it is showing as NUMERIC.
I am looking for a solution that works without any additional OCX control. I thought that the default CDO/MAPI would work without installing any additional OCX
Regards
Anser
&
Anser,
Search for "TPOP3"
James
Dear Mr.James,
Thank you. FiveWin's TPop3 is working fine and this the one which I was looking for. Now I need to understand the techniques used to extract the header, attachments, Subject, Sender's details etc. from the array aMsgs
Regards
Anser
Dear Mr.James,
Another problem which I see is that TPop3 downloads the whole email. (TelNet command RETR). I have to download the whole mail and then extract the headers from it and will be time consuming if attachments are there ( depends on the email size). Hope there is some other technique to get the header only (From,To,Subject,Email Size), so that it is faster. Nowadays, most mobile phone supports the retrieval of Email Headers. I know that TPop3 is supposed to be used to retrieve emails from POP3 servers. Just wondering whether another method exist to retrieve the header only. I did not find any TelNet commands to retrieve just the header. LIST will give the message no's and size in bytes
Regards
Anser
Just wondering whether another method exist to retrieve the header only.
oInMail = TPop3():New( cIp,, cUserName, cPassword )
oInMail:lHeaderOnly:=.T. // Retrieves only the headersHi Anser,
Is it possible to share changes in TPop3 Class if you don't mind?
Thanks in advance.
DATA lHeaderOnly // New Data ::lHeaderOnly:=.F. // Initialize the Value to .F. if ::lHeaderOnly
cCommand = "TOP " + AllTrim( Str( 1, 4, 0 ) )+ " 0" + CRLF
Else
cCommand = "RETR " + AllTrim( Str( 1, 4, 0 ) )+ CRLF
Endif if ::lHeaderOnly
cCommand = "TOP " + AllTrim( Str( ++::nAtMsg, 4, 0 ) ) + " 0" + CRLF
Else
cCommand = "RETR " + AllTrim( Str( ++::nAtMsg, 4, 0 ) ) + CRLF
Endif if ::lHeaderOnly
cCommand = "TOP " + AllTrim( Str( ++::nAtMsg, 4, 0 ) ) + " 0" + CRLF
else
cCommand = "RETR " + AllTrim( Str( ++::nAtMsg, 4, 0 ) ) + CRLF
Endif