1

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?

  • You're going to need to add the message's MIME source in order for us to help you out here. In the Notes client, open the message and select the View menu, Show, and Page Source. Edit your question and add this information. – Richard Schwartz Aug 03 '22 at 14:02
  • Is this email generated in Notes? Or was it received from the outside? Short of using the link in the unformatted text as the URL in a web request, I don't see there's much you can do. – Duston Aug 03 '22 at 20:18
  • @Duston It was received from outside. – user10454837 Aug 04 '22 at 03:23
  • @RichardSchwartz, The Page Source content is too huge to paste and contains some information that cannot be posted in public(like the name of organization, etc.) Could you please let me know which part in the Page Source I can paste here that may be helpful? – user10454837 Aug 04 '22 at 03:43
  • At very least, the initial content-type header, plus all of the section headers (separator, content-transfer-econding, content-type). Plus anything (header, content, script...) in the content that contains the hyperlink text that is being returned in your code. – Richard Schwartz Aug 05 '22 at 12:54
  • @RichardSchwartz, If we open the message in client and go to View->Show->Page Source, we see the actual email text there. It seems that the Body field of Notes document contains only partial data and that's why our lotusscript agent is not able to read it. Any idea why the Body field contains only partial data? If it contains the complete data as present in the Page Source, probably our agent will be able to read it. – user10454837 Aug 16 '22 at 07:34

2 Answers2

1

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
Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
UncleMike
  • 11
  • 2
0

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.

Richard Schwartz
  • 14,463
  • 2
  • 23
  • 41
  • MIME headers are also seen along with the actual email text, but the below piece of code returns "Not MIME!". Therefore we are not able to use any methods of the NotesMIMEEntity class. `Dim mime As NotesMIMEEntity Set mime = doc.GetMIMEEntity If Not(mime Is Nothing) Then MsgBox "MIME!" Else MsgBox "Not MIME!" End If` – user10454837 Aug 18 '22 at 11:24
  • Hmmm... You said above that the Body field does not contain the actual email text. And now doc.GetMIMEEntity fails, and the default for that method if you don't specify an item name is "Body", so I guess the question is what field actually does contain it. What, if any, items starting with a '$' character are listed on the second tab of the document properties box for the document in question? – Richard Schwartz Aug 18 '22 at 13:42
  • As per the last comment I wrote, The Body field in the Notes document actually does not contain the complete data. So we are not really sure if the part of the data that is not present in the Body field somewhere contains the actual email text too. If we could find a way to get the complete data in the Body field, we will get to know if it contains the email text or doesn't. – user10454837 Aug 18 '22 at 14:25