Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

format email message

Status
Not open for further replies.

cramd

Programmer
Mar 28, 2001
214
US
I have a form that includes a "messageBody" - rich text field. Within lotus script, I create an email message with the "messageBody" that is selected by a user. The email that is delivered has the message body wrapped incorrectly only for the first paragraph. The second paragraph of the email is fine. Example:
This is an example of the line wrapping with a rich text
field
from an email message that is created with lotus script.
When the
user creates the message body on the form, no carriage
returns are
included, instead the message body field automatically
wraps the text.

For the second paragraph of the email message, the wrapping is correct. Both paragraphs are entered in the message body field at the same time. Any suggestions regarding the wrapping problem would be appreciated!

cramd
 
Where does the text you enter come from : is it hard-coded, or do you take it from a document ?

Maybe you could post some of your code ?

Pascal.
 
Pascal,
Here is the lotus script code. Doc2 contains the subject and the message that has been created on a form by users.
Doc contains information about the customer, email address, salutation, etc......
I've thought about changing the rich text message to an html message and trying again, but I would really like to understand why the message is formatted (wrapped) the way it is when it is received by the customer. Any thoughts on using an HTML message versus a rich text message?? Or any suggestions to the code would be appreciated!

cramd
************************************************
Sub Click(Source As Button)
Dim session As New notessession
Dim db As notesdatabase
Dim view As notesview
Dim doc As notesdocument
Dim maildoc As notesdocument
Dim olddoc As notesdocument
Dim count As Integer
Dim message As String
Dim subj As Variant
Dim sal As Variant
Dim newline As String
Dim msgbody As Variant
Dim collection As NotesDocumentCollection
Dim doc2 As NotesDocument
Dim URL As String

Set db=session.currentdatabase
Set collection = db.UnprocessedDocuments
Set doc2 = collection.GetFirstDocument()
Set view=db.getview("custVW")
Set doc=view.getfirstdocument
count = 0
subj = doc2.GetItemValue("dlsubject")

' Call disclaimer

URL = " ' + doc2.GetItemValue("rtWebPage")
newline = Chr(13)
msgbody = doc2.rtmessage

Do While Not doc Is Nothing
sal = doc.salutn(0)

Set maildoc=db.createdocument
maildoc.form="memo"
maildoc.sendto = doc.email(0)
maildoc.replyto = "webmaster2@test.org"
maildoc.subject = subj
'create message body
maildoc.body = "Dear " + sal + ":" + newline + newline
maildoc.body = maildoc.body(0) + msgbody + newline + URL

count = count + 1
'send email
Call maildoc.send(False,maildoc.sendto(0))
Set olddoc=doc
Set doc=view.getnextdocument(olddoc)
Delete olddoc
Delete maildoc
Loop

message = count & " emails have been sent"
Messagebox message, MB_OK, "Email Count"

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top