MIME Error Message - Help Needed

Hi,

I have a stored form that contains a rich-text field named GCC. We want to load HTML code using LotusScript into this field and then send (mail) the form to a few recipients. The problem is we couldn’t get the brackets or the passthru flag to work but we have been successful in creating a mime entity named GCC (instead of the default body) which will render the HTML. When we save it everything looks fine… but when we send it we get the following error:

Illegal use of non-Body MIME_PART(s) 4536 on line # (# = to the line for maildoc.send(true) below)

I tried to search the forum for this error and couldn’t get a hit.

If I change the field name on the form to “Body” and use the default MIME code everything is fine. Eventually we want to have more than one field so we need to create our own field (mime) entities. If I open the document in the view and press “Forward”… it will work as well but we need to automate the sending of this email.

I thought maybe adding a “Body” and populating it would get around the error but no luck. I also even removed the stored form and changed it to send(False)… same error.

Here is the code to populate the stored form:

<<>>>

Dim s As New notessession

Dim db As NotesDatabase

Dim maildoc As notesdocument

Set db = s.currentdatabase

Set uname = New notesname(s.username)

Dim gccstream As NotesStream

Set gccstream = s.CreateStream

Dim gcc As NotesMIMEEntity

s.ConvertMIME = False

Set maildoc = db.createdocument

With maildoc

.Form = “frmTable”

.SendTo = uname.canonical

.Subject = “Table Test”

Call gccstream.WriteText(“GCC Test”)

Set gcc = .CreateMIMEEntity(“gcc”)

Call gcc.SetContentFromText (gccstream, “text/html;charset=iso-8859-1”, ENC_NONE)

Call .save(True, False)

Call .send(True) 'this line causes the error

End With

s.ConvertMIME = True

<<>>

Thanks for any help…

Brent

Subject: MIME Error Message - Help Needed

see if this is useful.http://searchdomino.techtarget.com/tip/0,289483,sid4_gci953261,00.html

Subject: RE: MIME Error Message - Help Needed

Thanks for responding but no that just uses a single default Body field… I’m using a different entity name besides body.

The reason is I actually want to have five different mime entities in one email but I can’t even get one to work without using Body. According to other posts it has been done but I must be missing something.

Thanks in advance for any additional help.

Brent

Subject: RE: MIME Error Message - Help Needed

Hello,

I realize that the message is old, but I thought to post a solution, just in case someone might need it in the future.

Here is the replacement code:

<<>>>

Dim s As New notessession

Dim db As NotesDatabase

Dim maildoc As notesdocument

Set db = s.currentdatabase

Set uname = New notesname(s.username)

Dim gccstream As NotesStream

Set gccstream = s.CreateStream

Dim gcc As NotesMIMEEntity

s.ConvertMIME = False

Set maildoc = db.createdocument

With maildoc

.Form = “frmTable”

.SendTo = uname.canonical

.Subject = “Table Test”

Call gccstream.WriteText(“GCC Test”)

'Set gcc = .CreateMIMEEntity(“gcc”)

Set gcc = .CreateMIMEEntity(“gccTemp”)

Call gcc.SetContentFromText (gccstream, “text/html;charset=iso-8859-1”, ENC_NONE)

Call .save(True, False)

’ Call .send(True) 'this line causes the error

End With

s.ConvertMIME = True 'this needs to be here

’ ADDITIONAL CODE

Dim item As Notesitem

Set item = maildoc.GetFirstItem(“gccTemp”)

Call maildoc.CopyItem(item,“gcc”)

Call item.Remove()

Call maildoc.Save(True, False)

Call .send(True) ’ this will work OK now

’ END ADDITIONAL CODE

<<>>

Worked fine for me both on Domino 6.5, 7 and 8.

Brindu