href tags does not result in the full url with Redemption

D

DPM

Hi,

I am using a program which reads emails from a selected folder of MS
Outlook(2003 SP3).
I have noticed the following,
- A mail has the <base href> tag defined in the header of the mail html
- The mail body has a relative tag with <a href>
Once the MailItem.HTMLBody is read the relative tag(<a href>) is replaced
with the full url.

eg. The mail has the following html as the source
<html>
<head>
<base href="http://sample.com/aa/bb/cc"></base>
</head>
<body>
<a href="dd">Text</a>
</body>
</html>

The MailItem.HTMLBody returns the following
<html>
<head>
<base href="http://sample.com/aa/bb/cc"></base>
</head>
<body>
<a href="http://sample.com/aa/bb/dd">Text</a>
</body>
</html>

But when Redemption.SafeMailItem is used its html results as per original
mail above(1st html) without the full url for the href tags.
Is there a facility in Redemption to read the html with the full urls as per
MS Outlook mail item?
Redemption ver. in use, 4.5.0.812.

Please advice.
 
D

Dmitry Streblechenko

AFAIK Outlook loads the HTML blob into an HTMLDocument object, which parses
the HTML.
Redemption simply extracts the HTML body as-is.

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
 
D

DPM

Dmitry,

Thanks.
Could you give some hints on how to use the HTMLDocument object so that it
is possible to generate the full urls.
 
D

Dmitry Streblechenko

You'd think that would be easy... Essentially you need to create an instance
of the HTMLDocument object, QI it for IMarkupServices, then call
IMarkupServices::parseString. That method fails a lot on real-world HTML, so
you'd then need to QI for IPersistStreamInit and then call
IPersistStreamInit::Load, which is asynchronous, so you'd need to wait until
HTMLDocument.readyState property becomes "complete" or "interactive".

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
 
D

DPM

Thanks Dmitry.

Dmitry Streblechenko said:
You'd think that would be easy... Essentially you need to create an
instance of the HTMLDocument object, QI it for IMarkupServices, then call
IMarkupServices::parseString. That method fails a lot on real-world HTML,
so you'd then need to QI for IPersistStreamInit and then call
IPersistStreamInit::Load, which is asynchronous, so you'd need to wait
until HTMLDocument.readyState property becomes "complete" or
"interactive".

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top