Check this:
body = "hello%0D%0Ahello%0D%0Ahello"
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
i've been looking around and tried a few different coding ways to get the email body to have line breaks, and i can not seem to get it to work. the email populates correctly with everything it needs. just can't get the message body to have line breaks. i have tried. <br>, appendline, vbnewline, and vbcrlf. and no luck. any help would be appreciated. i do not know if i need to add a resource at the beginning of the class if thats the hang up.
Option Strict On
Option Explicit On
Public Class NewHireEmail
Dim firstname As String
Dim lastname As String
Dim firstlastname As String
Dim NPN As String
Dim MGA As String
Dim GA As String
Dim SA As String
Dim trainingclass As String
Private Sub LinkLabel1_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked
Process.Start("https://nipr.com/help/look-up-your-npn")
End Sub
Public Sub NewAgent()
firstname = TextBox1.Text
lastname = TextBox2.Text
firstlastname = firstname + " " + lastname
End Sub
Public Sub dateofclass()
trainingclass = DateTimePicker1.Value.ToString("d")
End Sub
Public Sub NPNNumber()
NPN = TextBox3.Text
End Sub
Public Sub ManagerHierarchy()
MGA = TextBox4.Text
GA = TextBox5.Text
SA = TextBox6.Text
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim body As String
Dim subject As String
Dim address As String
If RadioButton1.Checked = True Then
Call NewAgent()
Call NPNNumber()
Call ManagerHierarchy()
address = "******@test.com"
subject = "New Hire " & firstlastname
body = "hello <br> hello <br> hello"
Process.Start(String.Format("mailto:{0}?subject={1}&body={2}", address, subject, body))
End If
End Sub
Private Sub RadioButton1_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton1.CheckedChanged
If RadioButton1.Checked = True Then
RadioButton2.Checked = False
Label9.Visible = False
DateTimePicker1.Visible = False
End If
End Sub
Private Sub RadioButton2_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton2.CheckedChanged
If RadioButton2.Checked = True Then
RadioButton1.Checked = False
Label9.Visible = True
DateTimePicker1.Visible = True
End If
End Sub
End Class
Check this:
body = "hello%0D%0Ahello%0D%0Ahello"
Hi
Further to the reply by Viorel.
This example uses the text from a TextBox1 on the Form for the email body.
Dim body As String
Dim subject As String
Dim address As String
' plain text email use %0D%0A
' HTML text use tag instead <br/>
Dim mynewline As String = "%0D%0A"
address = "******@test.com"
subject = "New Hire " & "Freddy MacBloggs"
body = TextBox1.Text.Replace(vbCrLf, mynewline)
Process.Start(String.Format("mailto:{0}?subject={1}&body={2}", address, subject, body))