Sent Mail format problem while sending mail in backend

Hi,

I am lotus Notes developer. I have been facing one problem.

Whenever I create and send the mail memo in backend through code, it formating gets disturbed (no bold, no italic etc) , but if i sends mail memo in UI (frontend), there is no problem at all in formatting. Everything is same.

Why is happens? Is there any solution of this.

thanks in advance.

Imtiaz

Subject: Sent Mail format problem while sending mail in backend

Hi,

Use NotesRichTextStyle class to set the style to the RichTextItem Body in the code to have all the above.

HTH

Keshava

Subject: RE: Sent Mail format problem while sending mail in backend

Hi,

Thanks Kesava for your suggestion. Can you please provide a “sample code” to send simple mail through backend.

I would really appreciate your help.

Thanks for sparing your time.

Imtiaz

Subject: RE: Sent Mail format problem while sending mail in backend

This is just an example for bold / italic … you can check for more in notes help NotesRichTextStyle

HTH

Keshava

===============================================

Dim session As New NotesSession

Dim currebtDb As NotesDatabase

Set currentDb = session.CurrentDatabase

Dim memoDoc As NotesDocument

Dim richStyle As NotesRichTextStyle

Dim recipients( 1 ) As String

Set memoDoc = currentDb.CreateDocument()

memdoc.Form =“Memo”

memoDoc.From = session.UserName

memoDoc.Subject = “Test Email”

Set richStyle = session.CreateRichTextStyle

richStyle.NotesFont = FONT_COURIER

richStyle.FontSize = 14

Set richText = New NotesRichTextItem(memoDoc, “Body”)

Call richText.AppendStyle(richStyle)

Call richText.AppendText(“Hi,”)

Call richText.AddNewLine(2)

Call richText.AppendText(“contents”)

richStyle.Bold = True

Call richText.AppendStyle(richStyle)

Call richText.AppendText(“This is in bold”)

Call richText.AddNewLine(1)

richStyle.Bold = False

Call richText.AppendStyle(richStyle)

Call richText.AppendText(“This is not Bold”)

Call richText.AddNewLine(1)

richStyle.Italic = True

Call richText.AppendStyle(richStyle)

Call richText.AppendText(“This is italic”)

Call richText.AddNewLine(1)

richStyle.Italic = False

Call richText.AppendStyle(richStyle)

Call richText.AppendText(“This is not Italic”)

recipients( 0 ) = “firstmail”

recipients( 1 ) = “second Mail”

Call memoDoc.Send( True, recipients )

Subject: RE: Sent Mail format problem while sending mail in backend

Hi Mr. Keshava,

Thanks for you cooperation. I have applied your sample code. But the problem is that it is fine when the mail is arrived in the “Lotus Notes Client”, but when it is received on the yahoo, hotmail or gmail account. it total removes the formatting.

Note: This was previously happening to me same like this.

Is there any changes needed in the server document or MIME/html setting in the Lotus Notes client.(I already had setting of MIMe in notes client.)

Please give me some suggestion, how we can solve this problem.

Thanks. imtiaz