Fluoronator
Technical User
I have a VB program which sends Lotus Notes e-mail. The program works well except for one problem... When I try to send two lines of text in the body (separating them with vbCrLf) I get one line with an ugly little character representing the vbCrLf between the two lines of text. When I run the code below, the receiver of the e-mail sees something like this in the body of the message...
This is the first line of body text.||This is the second line of body text.
How can I format the body text to include carriage returns/line feeds and maybe even rich text with bold and colors?
***** Here is the complete code *****
Dim Session As New Domino.NotesSession
Dim Database As NotesDatabase
Dim Document As NotesDocument
Private Sub Command1_Click()
SendMail
End Sub
Private Sub SendMail()
Dim ServerName As Variant
Dim FileName As Variant
Dim SubjectText As String
Dim BodyText As String
Dim MailingList(2) As String
Dim PassWord As String
PassWord = "MyPassWord"
MailingList(0) = "TheFirstGuy"
MailingList(1) = "TheSecondGuy"
MailingList(2) = "TheThirdGuy"
SubjectText = "This is the subject text."
BodyText = "This is the first line of body text." & vbCrLf _
& "This is the second line of body text."
Call Session.Initialize(PassWord)
ServerName = Session.GetEnvironmentString("Mailserver", True)
FileName = Session.GetEnvironmentString("Mailfile", True)
Set Database = Session.GetDatabase(ServerName, FileName)
Set Document = Database.CreateDocument
With Document
.AppendItemValue "SendTo", MailingList
.AppendItemValue "Subject", SubjectText
.ReplaceItemValue "Body", BodyText
.Send False
End With
Unload Me
End
End Sub
This is the first line of body text.||This is the second line of body text.
How can I format the body text to include carriage returns/line feeds and maybe even rich text with bold and colors?
***** Here is the complete code *****
Dim Session As New Domino.NotesSession
Dim Database As NotesDatabase
Dim Document As NotesDocument
Private Sub Command1_Click()
SendMail
End Sub
Private Sub SendMail()
Dim ServerName As Variant
Dim FileName As Variant
Dim SubjectText As String
Dim BodyText As String
Dim MailingList(2) As String
Dim PassWord As String
PassWord = "MyPassWord"
MailingList(0) = "TheFirstGuy"
MailingList(1) = "TheSecondGuy"
MailingList(2) = "TheThirdGuy"
SubjectText = "This is the subject text."
BodyText = "This is the first line of body text." & vbCrLf _
& "This is the second line of body text."
Call Session.Initialize(PassWord)
ServerName = Session.GetEnvironmentString("Mailserver", True)
FileName = Session.GetEnvironmentString("Mailfile", True)
Set Database = Session.GetDatabase(ServerName, FileName)
Set Document = Database.CreateDocument
With Document
.AppendItemValue "SendTo", MailingList
.AppendItemValue "Subject", SubjectText
.ReplaceItemValue "Body", BodyText
.Send False
End With
Unload Me
End
End Sub