Sending the document works, but if the length of the HTML content exceeds a certain size, the resulting mail contains the string "!\n " at multiple positions. I thought there might be a problem with the MIME conversion and added "MailConvertMimeOnTransfer=0" to the notes.ini. Unfortunately, this didn't help.
Does anyone know how to solve this problem?
PS: I also tried using Mark Leusink's HTMLMail class from OpenNTF (http://openntf.org/XSnippets.nsf/snippet.xsp?id=create-html-mails-in-ssjs-using-mime), but I also faced the problem described above.
The problem only occurs with mails sent to internet users. Notes users recieve the correct HTML mail.
The problem can be solved by altering the encoding of the MIME entity. I just changed the encoding from NotesMIMEEntity.ENC_NONE to NotesMIMEEntity.ENC_IDENTITY_8BIT, and now the "!\n " strings a no longer inserted into to mail body when executing NotesDocument.send().
All the credit is due to stwissel who provided this solution.