Highlighted
DamianPM Absent Member.
Absent Member.
5463 views

How extract the HTML from a mail

Hi,

How can I extract the HTML body of a Novell Groupwise mail item using the APIs. This HTML also need to have the embedded images, which can even be reffered from a local folder.

A sample code in VB or a some references would help. Please advice.
Labels (1)
Tags (2)
0 Likes
7 Replies
ukdtom Absent Member.
Absent Member.

Re: How extract the HTML from a mail

Look for an attachment named text.htm

Then digest it, and look for embedded pictures....those will also be in
the attachment collection


--
Tommy Mikkelsen
IT Quality A/S, Denmark
Novell Support Forums SYSOP / NKP

Sorry, but no support through email
Please join http://www.open-horizons.net

Best Regards Tommy Mikkelsen Denmark Please Report back any success or failure, That way we all learn Sorry, but no support through email "I hate bugs".......Tommy Lee Jones, MIB
0 Likes
DamianPM Absent Member.
Absent Member.

Re: How extract the HTML from a mail

Thanks.

The embedded images in the HTML has the following within the img tag,
src="cid:image004.jpg@01CAA8D1.C05E09A0"

The attachment collecection does not have a image004.jpg but has a image.jpeg

How can these images be linked or update the image tags so that it picks the image from a local folder.

The HTML preview of the email in NGW email application shows the embedded images correctly.
0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: How extract the HTML from a mail

On 2/12/2010 7:06 AM, DamianPM wrote:
>
> Thanks.
>
> The embedded images in the HTML has the following within the img tag,
> src="cid:image004.jpg@01CAA8D1.C05E09A0"
>
> The attachment collecection does not have a image004.jpg but has a
> image.jpeg
>
> How can these images be linked or update the image tags so that it
> picks the image from a local folder.
>
> The HTML preview of the email in NGW email application shows the
> embedded images correctly.
>
>

you have to parse the mime.822 file in those cases.
0 Likes
ukdtom Absent Member.
Absent Member.

Re: How extract the HTML from a mail

Ahhmmm....Nope....AFAIK

When you look at the attachment list, they are listed in order......

So if the html first ref. to src="cid:image004.jpg@01CAA8D1.C05E09A0"
then that's the first attachment after the text.htm and so on....

Only thing that might interfere with this, is digital signature, and I
simply can't remember if that's put in last on first


--
Tommy Mikkelsen
IT Quality A/S, Denmark
Novell Support Forums SYSOP / NKP

Sorry, but no support through email
Please join http://www.open-horizons.net

Best Regards Tommy Mikkelsen Denmark Please Report back any success or failure, That way we all learn Sorry, but no support through email "I hate bugs".......Tommy Lee Jones, MIB
0 Likes
DamianPM Absent Member.
Absent Member.

Re: How extract the HTML from a mail

Thanks.
A few more things,

=> How to identify if a attachment is an embedded image?
Attachments.Item(Index).ObjType, return 1 for an attachment and an embedded image.

=> For each embedded image is there a way to get the reference in the HTML such as the cid, so that it can be searched and replaced with the physical file name?
0 Likes
ukdtom Absent Member.
Absent Member.

Re: How extract the HTML from a mail

DamianPM wrote:

>=> How to identify if a attachment is an embedded image?
>Attachments.Item(Index).ObjType, return 1 for an attachment and an
>embedded image.


digest the html part, and start counting the CID entries


>=> For each embedded image is there a way to get the reference in the
>HTML such as the cid, so that it can be searched and replaced with the
>physical file name?


?


--
Tommy Mikkelsen
IT Quality A/S, Denmark
Novell Support Forums SYSOP / NKP

Sorry, but no support through email
Please join http://www.open-horizons.net

Best Regards Tommy Mikkelsen Denmark Please Report back any success or failure, That way we all learn Sorry, but no support through email "I hate bugs".......Tommy Lee Jones, MIB
0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: How extract the HTML from a mail

In 8.0, we expose the content-type and content-id
of the attachments.
The HTML message body attachments are grouped
together as attachments. The text.htm attachment
is first followed by any embedded graphics
attachments. Each embedded graphic attachment
will have an content-id value.

The logic is to get the text.htm attachment and
any following attachments that have a content-id
until there is not an attachment or an attachment
does not have an content-id.

Preston

>>> On Friday, February 12, 2010 at 8:06 AM,

DamianPM<DamianPM@no-mx.forums.novell.com> wrote:

> Thanks.
>
> The embedded images in the HTML has the following within the img tag,
> src="cid:image004.jpg@01CAA8D1.C05E09A0"
>
> The attachment collecection does not have a image004.jpg but has a
> image.jpeg
>
> How can these images be linked or update the image tags so that it
> picks the image from a local folder.
>
> The HTML preview of the email in NGW email application shows the
> embedded images correctly.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.