Why does notes alters HTML-mail

HTML mail sent by our notesclients to an external addres is received in wrong format.1) Fontsettings are replaced

  1. CSS part cutted from original

  2. images_url replaced by a notes_id

  3. tags are deleted from message

The messages are created by our iSeries and sent in MIME format to the notes_client. The message is received correctly by Notes.

Then, the user forwards the message to the external (or internal) addres.

I found a tech_doc which said to change the settings of Location document → Mail tab → “Format for messages addressed to internet addresses” to “Notes Rich Text” in stead of “MIME” (Then only the Router will convert to MIME) but

it only solved another ‘Table’-problem.

Example:

  1. Format send to Notesclient
<link rel="stylesheet" href="http://www.clippersupport.be:2021/theme/Conti7Email.css">

<title>iSeries Mail Message</title>
<tr>

	<td width=178 bgcolor=#FFFFFF><img border=0 src='http:/www.clippersupport.be:2021/images/AcsaLogo.jpg' width=178 height=68></td>

	<td width=522 bgcolor=#6699FF align=center><p><b><i><font size='6' face='Verdana'>Billad Input Confirmation</font></i></b></td>

</tr>



<tr bgcolor="#C0C0C0">

	<td width="700" colspan="2"><b>Customer Info</b></td>

</tr>

<tr>

	<td width="200">Customer&nbsp;<br>PhoneNr<br>Email</td>

	<td width="500"> SHIPPING &amp; TRANSPORT NV<br>&nbsp;+32 3 2060450<br>&nbsp; <a href="mailto:kathyv@shiptrans.com"> kathyv@shiptrans.com</a>

</tr>

<tr>

	<td width=700 valign="top" colspan="2">&nbsp;</td>

</tr>

<tr bgcolor="#C0C0C0">

	<td width=700 valign="top" colspan="2"><b>Billad Info:</b></td>

</tr>
  1. Format received by Outlookclient
<tr valign="top">

	<td width="179" bgcolor="#FFFFFF" valign="middle"><p><img src="cid:1__=4EBBF888DFA3C1578f9e8a93df93@westphal.be" width="178" height="68"></td>

	<td width="517" bgcolor="#6699FF" valign="middle"><div align="center"><b><i><font size="7" face="Verdana">Billad Input Confirmation</font></i></b></div></td>

</tr>


<tr valign="top">

	<td width="698" bgcolor="#C0C0C0" colspan="2" valign="middle"><b><font size="2" face="Verdana">Customer Info</font></b></td>

</tr>

<tr valign="top">

	<td width="199" valign="middle"><font size="2" face="Verdana">Customer </font><font size="2" face="Verdana"><br></font>

		<font size="2" face="Verdana">PhoneNr</font><font size="2" face="Verdana"><br></font>

		<font size="2" face="Verdana">Email</font></td><td width="497" valign="middle">

		<font size="2" face="Verdana">SHIPPING &amp; TRANSPORT NV</font>

		<font size="2" face="Verdana"><br></font>

		<font size="2" face="Verdana"> +32 3 2060450</font>

		<font size="2" face="Verdana"><br></font>

		<font size="2" face="Verdana">  </font><a href="mailto:kathyv@shiptrans.com"><u>

		<font size="2" color="#0000FF" face="Verdana">kathyv@shiptrans.com</font></u></a></td>

</tr>

<tr valign="top">

	<td width="698" colspan="2"><font size="2" face="Verdana"> </font></td>

</tr>

<tr valign="top">

	<td width="698" bgcolor="#C0C0C0" colspan="2"><b><font size="2" face="Verdana">Billad Info:</font></b></td>

</tr>

Subject: Why does notes alters HTML-mail

The Notes client does not natively understand MIME, so any message received in MIME format has to be converted to Notes rich text format (referred to sometimes as CD records or Composite Data records). When a message is forwarded, even if no other changes are made to it, it will first be converted to Notes rich text, then have the Forward line added at the beginning, then sent on. If you change your setting to send in MIME, it simply means it will be converted back to MIME before it is sent, but if you have ever read a message translated English to French to English (or French to English to French for that matter), there is loss in the translation.

See my article Rich Text 101 - MIME/HTML for some explanation about where the loss occurs and how to explain it to others.

Subject: RE: Why does notes alters HTML-mail

We want to sent messages from Notes to external clients in HTML format.

Now we create the message on or iSeries and send it to users Notes-client using RPG+java+smtp. ‘Format messages to the internet’ is selected at both our server and client. The messages are initially received correctly by the users notes client (images/tables/fonts are ok).

But then, the users sends the message to the internet-addressee which ends up in wrongly formatted messages.

Is it possible to do get the message correctly AND sent it externally without any conversion?

Subject: RE: Why does notes alters HTML-mail

Certainly, but you can’t open the message. The way to do this is to use code such as:

session.ConvertMime = False

Set db = session.CurrentDatabase

Set collection = db.UnprocessedDocuments

Set doc = collection.GetFirstDocument

While Not (doc Is Nothing)

doc.SendTo = "Person@external-address.com"

doc.Subject = "Fwd: "+doc.Subject(0)

Call doc.Send(False)

Set doc = collection.GetNextDocument(doc)

Wend

The key idea is that the ConvertMime must be set to False BEFORE you open the document in script, and setting any field on the document requires opening it first, even though there is no explicit open method. This mainteians the MIME content, and allows you to change the SendTo and other such values, and pass the message along.

This script would have to run from the view, and you would probably need to make sure the preview pane was not open.