Body field of Notes mail document does not contain the email text

521 Views Asked by At

The Body field of Notes mail document in the database does not contain the actual email text at all, but just contains the HTML elements.

However, the actual email text is seen when this Notes mail document is opened in the browser.

We are using the below code snippet to fetch the email text:

 Set nrtNotesRichTextItem=ndocEmailDocument.GetFirstItem ("Body")

strEmail = strEmail + "<br>" + nrtNotesRichTextItem.GetUnformattedText

As the Body field does not contain the actual email text, the variable strEmail is not returning the text, but returning the hyperlink text which when is clicked, redirects to a web page that contains the actual email text that we need.

Any leads on this?

2

There are 2 best solutions below

3
Richard Schwartz On

Based on what you have described in comments, you are dealing with a large MIME message. Do you see just the actual text in View -> Show Page Source? Or do you see MIME headers, dividers, tags, and text? This is the crucial question.

Notes provides a GetMIMEEntity method in the NotesDocument class and it provides the NotesMIMEEntity class with various methods to traverse the structure of a MIME message and extract its content.

1
UncleMike On

You probably have a multi-value Body. (Confirm by looking at the items in the properties of the document: Alt+Enter, second tab, scroll in the left pane to find "Body" and see how many times it occurs.)

Try accessing the rest using v in something like the below:

Forall v In nrtNotesRichTextItem.Values
   
End Forall