Creating a text email using LotusScript

Domino Designer
Web development
How do I create a text email to a user who is not using notes as their email program. Situation, we have users that are using outlook and some using notes to receive mail. The problem is that when the application in notes sends out the email, the fields are viewable by users with the notes client but not viewable by users with outlook. I want to send an email that has just text in the body with the field values from notes. Is this possible?

Answer Wiki

Thanks. We'll let you know when a new response is added.

Sure. You need to build the Body field of the memo using the NotesRichTextItem object, and you can use any fields you like as you build it. Here’s an example (the style stuff for formatting is of course optional)…hope it works for you…

Dim session as New NotesSession
Dim newnote As NotesDocument
Dim rtItem As NotesRichTextItem
Dim style As NotesRichTextStyle

Set newnote = New NotesDocument(db )
newnote.Subject = “Subject: ” & doc.YourSubjectField(0)
newnote.SendTo = “”
newnote.CopyTo = “”
newnote.Form = “Memo”
Set rtItem = New NotesRichTextItem(newnote , “Body” )
Set style = session.CreateRichTextStyle
Call rtitem.AppendStyle(style)
Call rtItem.AppendText(doc.YourFieldInBold(0))
Call rtitem.AppendStyle(style)
Call rtItem.AddNewline(2) // add carriage returns
Call rtItem.AppendText(” More text, whatever you want.”)
Call newnote.Send(False)

Discuss This Question: 1  Reply

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • Brooklynegg
    That lotuscript richtext item method might work. Check and see. If it doesn't, then you can concatenate field labels and values and carriage returns, then simply assign them to the .body field. Make all the labels all-caps with a colon, then all the data in regular case, or some other method to make it readable. Something like this should work. Desc would have to be dimmed as a string, etc. Desc = "ASSIGNED TO: " & doc.Assigned(0) & Chr$(10) &_ "STATUS: " & doc.Issue_Stat(0) & Chr$(10) &_ "DESCRIPTION: " & doc.Description(0) & Chr$(10) &_ Chr$(10) &_ "COMMENTS/RESOLUTION: " & doc.Resolution(0) newnote.Body = Desc
    3,845 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: