I am having a problem with the body of an email accepting returns. This code will launch the default mail application and populate fields automatically. If the body has returns in it, the body in the new mail screen (in outlook in my case) --- shows in one continuous line.
The EmailBody field is populated with the contents of a text box with multiline property set to true. The operator enters the body in the text box returning between paragraphs. When outlook new mail panel is displayed, the whole body is displayed with no returns.
Is there something I need to do to allow for the returns?
VB Code:
Public Sub setEmailOutgoing(ByVal EmailServer As String, ByVal EmailTo As String, ByVal EmailFrom As String, ByVal EmailSubject As String, ByVal EmailBody As String, ByVal SMTPPort As Integer) Dim mm As New MailMessage Dim smtp As SmtpMail If Not (EmailServer = "") Then smtp.SmtpServer = EmailServer End If mm.To = EmailTo mm.From = EmailFrom mm.Subject = EmailSubject mm.Body = EmailBody If Not (SMTPPort = 0) Then mm.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", SMTPPort) End If smtp.Send(mm) End Sub




Reply With Quote