问题描述:

I'm using NotesDocument.send() to send HTML mails. With server-side javascript, the HTML code (html) is added to the NotesDocument (doc) as follows:

session.setConvertMime(false);

...

var mimeBody:NotesMIMEEntity=doc.createMIMEEntity("Body");

var stream:NotesStream=session.createStream();

stream.writeText(html);

mimeBody.setContentFromText(stream,"text/html;charset=\"UTF-8\"",NotesMIMEEntity.ENC_NONE);

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.

UPDATE:

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.

相关阅读:
Top