Kelley Johnson
Member
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?
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.NET:
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("[URL]http://schemas.microsoft.com/cdo/configuration/smtpserverport[/URL]", SMTPPort)
End If
smtp.Send(mm)
End Sub