Solved

Retrieve internet Email??

Posted on 2004-09-21
42
286 Views
Last Modified: 2010-04-16
Hi, I have a very straightforward questions, but I am not certain that the solution to the prblem is all that simple..
I am wondering how I can fetch eg. mail from an hotmail account in to the email client program I have built?? Is this possible at all without relying on third party software?
I have been stuck on this for a while so all help will be greately appreciated :)
R
0
Comment
Question by:Runelurenavn
  • 20
  • 10
  • 7
  • +2
42 Comments
 
LVL 7

Expert Comment

by:sftweng
Comment Utility
0
 

Author Comment

by:Runelurenavn
Comment Utility
Have looked at it now and will try to implement it. Have to say it seems complex!
What if I want to get access to yahoo mail or perhaps even the new google mail? Do I need this kind of "specific" code as for hotmail?
Thanks for help so far!
R
0
 
LVL 26

Expert Comment

by:EddieShipman
Comment Utility
If you need help with it, le me know. I wrote the article. This code is specific to Hotmail.

I have been meaning to, just not enough time in a day...
1. convert to use sockets instead of XMLHTTP
2. write a clone of YahooPop which basically does the same thing but for Yahoo.
3. Write one for GMail when I figure out how it works. I have a GMail account but have not done any sniffing, yet.
0
 
LVL 26

Expert Comment

by:EddieShipman
Comment Utility
I am also writing a custom component that encapsulates the article code.
0
 

Author Comment

by:Runelurenavn
Comment Utility
Thanks for helping out  :)

Here's my 1st problem: When I try to install the typelibrary I get an error message saying "A class named TXMLDocument is already installed". The problem is that I dont know where/what to uninstall to make this work. I have played around with this for a while already - trying out all sorts of things,but with no luck..
R
0
 
LVL 7

Expert Comment

by:sftweng
Comment Utility
Is it the Microsoft XML Typelibrary that you're trying to install? What version and level of Delphi are you working with, Delphi 6 Enterprise?
0
 
LVL 7

Expert Comment

by:sftweng
Comment Utility
If it's already installed, you might just bele to start using it, otherwise you should use the Components file menu to remove it.
0
 

Author Comment

by:Runelurenavn
Comment Utility
Yes, I'm trying to install msxml2 /msxml3  on Delphi7 enterprise but I keep getting this error message "A class named TXMLDocument is already installed". I i initially thought that this meant msxml2/3 was installed, but I am almost certain it is only msxml1 that is already installed. This because when I add the typelibrary to my uses clause only mstypelibrary1 does not give an error message. When typelibrary1 IS included I get an error: TXMLHTTP is not recognised by the compiler. I assume this is due to an old version of the typelibrary being installed??
I just tried to remove the component TXMLDocument from the internet component tab, but it does not appear to have made any difference...
R
0
 
LVL 7

Expert Comment

by:sftweng
Comment Utility
I'm guessing a little here because I hace Delphi 6 Enterprise on this machine - you probably need to remove IXMLDocument from dclnet70
0
 
LVL 7

Expert Comment

by:sftweng
Comment Utility
Yes, I just confirmed dclnet70 on another machine with Delphi 7 Professional.
0
 
LVL 7

Expert Comment

by:sftweng
Comment Utility
See "Installing Component Packages" in Delphi Help.
0
 
LVL 26

Expert Comment

by:EddieShipman
Comment Utility
NO, all you have to do is place mshtml in your uses, you don't need to import the type lib.
0
 
LVL 26

Expert Comment

by:EddieShipman
Comment Utility
Man, I must be going blind. Let me rephrase that...
0
 
LVL 26

Expert Comment

by:EddieShipman
Comment Utility
I don't have a version with TXMLDocumetn here at work. I do at home and can get you the answer later today.
0
 

Author Comment

by:Runelurenavn
Comment Utility
I have tried to remove dcinet70's IXMLDocument but Delphi refuses me to access it in edit mode....
Here's what I did: Components\Install packages and then I selected the package to edit, but the edit button is still disabled! Have also tried to reimport the typelibrary and then just remove the offending class from the list, but it is (offcourse) not editable. How did you manage to remove the IXMLDocument??

Also added the mshtml to my uses clause but still got the error mesage "Undeclared identifier TXMLHTTP"..
0
 
LVL 26

Expert Comment

by:EddieShipman
Comment Utility
I only have D6 Pro here without TXMLDocument so I can't tell you right now.
0
 
LVL 26

Expert Comment

by:EddieShipman
Comment Utility
Have you tried renaming TXMLDocument in the Import Window to TMyXMLDocument?
You won't be using it anyway in the sample code.
0
 

Author Comment

by:Runelurenavn
Comment Utility
Great that works! Thanks, now I can finally get on with the implementation :)
0
 
LVL 26

Expert Comment

by:EddieShipman
Comment Utility
Also...

Although I don't have a subscription, Delphi Informant had an article by Alfred Mirzagitov
in I think December, about creating a POP3 proxy that accessed Hotmail just like my
article does as a client. I have the source from the article if you need it.

Part One:
http://www.delphizine.com/features/2004/01/di200401am_f/di200401am_f.asp
Part Two:
http://www.delphizine.com/features/2004/02/di200402am_f/di200402am_f.asp
0
 

Author Comment

by:Runelurenavn
Comment Utility
Thanks, if you have the source that would be a great help for me :)
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 26

Expert Comment

by:EddieShipman
Comment Utility
email me at mr_delphi_developer at yahoo dot com
0
 
LVL 26

Expert Comment

by:EddieShipman
Comment Utility
Runelurenavn,
  Was the code helpful? Ned more help?
0
 
LVL 2

Expert Comment

by:SaLz
Comment Utility
ok there are lots of demos with source cod in these links.

32 delphi indy demos are in here, check out the MAIL CLIENT in there.
http://www.indyproject.org/indy/demodownloads/Indy9Demos_26Oct04.zip

some more delphi source codes.
http://www.atozed.com/indy/Demos/Indy9.iwp
0
 
LVL 26

Expert Comment

by:EddieShipman
Comment Utility
Salz, no need to reply, the OP didn't want smtp access to email. He wanted access to HOTMAIL.
0
 

Author Comment

by:Runelurenavn
Comment Utility

Hi, I have used the sample code to try and get this hotmail thing going. So far I can access the server and log on, but I cannot seem to retrieve the messages. When I click the ‘inbox’ in the ttreenode, nothing happens. I have tried debugging, and I find that the nodeList (oNodeList) is not getting populated, so the for loop is always skipped, and no data is loaded.. The oNodeList lenght is zero when I check.. Have you got any idea what is wrong? Everything seems to be ok up to this point...

Here is the code that seems to cause problems. It's from the ParseMailboxInfo procedure:

oNodelist := oXMLDoc.selectNodes('//D:response');
  mNodeList := oXMLDoc.selectNodes('//D:prop');
  for i := 0 to oNodelist.length -1 do
  begin
    mInfo           := TMailInfo.Create;
    oMsgNode        := oNodelist.item[i];
    mInfo.Url       := oMsgNode.childNodes[0].text;
    mInfo.Subject   := mNodeList.Item[i].selectNodes('//m:subject').Item[i].text;

regards, R
0
 
LVL 26

Expert Comment

by:EddieShipman
Comment Utility
I will take alook at it to see if Hotmail's changes are causeing the problem.
What I usually do is anytime I load the XML, I also save it to a file and examine
the file to see what it is returning.

I also use OE to check its results against what I'm getting with my program.
There are instructions to do that in the first part of the article.
0
 
LVL 26

Expert Comment

by:EddieShipman
Comment Utility
Can you post your ResponseText? I just ran it and it worked flawlessly on both my accounts.

Although I have a previously unknown bug where you click on the root node of the tree.
I did not catch that one. I should not try to get any messages if the root node is clicked.
Now it just hangs when you click on the root node.

Also, are you trying Hotmail in a different country (than US)?
0
 

Author Comment

by:Runelurenavn
Comment Utility
Yes I AM using hotmail from outside the us. Norway to be more specific.....Does that change anything though?
0
 
LVL 26

Expert Comment

by:EddieShipman
Comment Utility
It is possible that the Unicode chars are causing problems in the XML.

Could you create a Norwegian HM account for me to test with and send me the link
to get to it?
0
 

Author Comment

by:Runelurenavn
Comment Utility
Ok, have created an account. Here's the details:
username: runelurenavn@hotmail.com
Password: 123456
0
 
LVL 26

Expert Comment

by:EddieShipman
Comment Utility
Tried it and got a "998 No extra explanation" error. ???
Place a brekpoint on the line where you are first getting the
FHotmailError in the Connect procedure.
See if the line
FHotmailError :=
       oXMLHTTP.getResponseHeader('X-Dav-Error');

returns '998 no extra eaplanation'

Can't use OE because HM now requires subscription
to access from OE or Outlook; the money hungry fools!

0
 
LVL 26

Expert Comment

by:EddieShipman
Comment Utility
Well, I looked at my HTTPMail.og file, that OE modifies when accessing HM and this is the last entry:

HTTPMAIL: 09:00:33 [rx]
HTTP/1.1 402 Access to Hotmail via Outlook and Outlook Express now requires a subscription. Please sign up at http://upgrade.msn.com
Connection: close
Date: Fri, 03 Dec 2004 15:00:32 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
P3P:CP="BUS CUR CONo FIN IVDo ONL OUR PHY SAMo TELo"
Set-Cookie: HMSatchmo=0;  domain=.hotmail.com; path=/
Set-Cookie: HMMS2954=7FECB06078A504C3483A4E6567FC22F4C0A5CEB799EF84A4CDD95CFB60D46D90;  domain=.hotmail.com; path=/
Cache-Control: private
Content-Type: text/html
X-Dav-Error: 998 No extra explanation
HMServer: H: BAY16-DAV10.phx.gbl  V: WIN2K3 10.00.1121.0073 i  D: Nov 21 2004 22:36:11 S: 0

See the HTTP 402 error message and the X-Dav-Error?

When you connect via OE, do you get the same message:
"Access to Hotmail via Outlook and Outlook Express now requires a subscription. Please sign up at http://upgrade.msn.com"

What is the name of the server that OE tries to connect to?
Should be in a line in your HTTPMail.log file that looks like this:
"PROPFIND http://services.msn.com/svcs/hotmail/httpmail.asp"
0
 
LVL 26

Expert Comment

by:EddieShipman
Comment Utility
You know, I'm beginning to think that MS allows users of older accounts to access Hotmail through WebDAV, like in my program.
I am able to access my three accounts, just fine. The one you just now created, no access.

When did you create your account?
0
 
LVL 14

Expert Comment

by:DragonSlayer
Comment Utility
Seems that all new Hotmail accounts will not have WebDAV access enabled. And as for existing users who have accessed their accounts via WebDAV before October 2004 (not sure about the exact date, could be mistaken), they will be able to continue using WebDAV until April 2005.

Read more about it here http://tinyurl.com/4cts5

For new Hotmail users or those that never accessed their account via WebDAV before, you would need to subscribe to MSN (http://upgrade.msn.com) to be able to continue WebDAV access for your account.
0
 
LVL 2

Expert Comment

by:SaLz
Comment Utility
shame
0
 
LVL 26

Expert Comment

by:EddieShipman
Comment Utility
Like I said...MONEY HUNGRY FOOLS!
0
 
LVL 26

Expert Comment

by:EddieShipman
Comment Utility
So, Runelurenavn, did you decide to get Hotmail Plus? Does it work for you if you did?
Are you going to close out this question?
0
 
LVL 7

Expert Comment

by:sftweng
Comment Utility
EddieShipman deserves the points
0
 
LVL 2

Expert Comment

by:SaLz
Comment Utility
ye, seems he posted quite allot lol
0
 
LVL 26

Accepted Solution

by:
EddieShipman earned 500 total points
Comment Utility
alot of correct stuff for what the OP wanted, to.
I guess that's how you get the points. ;-)
0
 

Author Comment

by:Runelurenavn
Comment Utility
Sorry, I forgot it! Eddie Shipman most certainly deserve all the points. I am very grateful for all his invaluable help.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now