954,517 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Help: Ending,

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSend.Click
        Dim strSubject As String 'subject title
        Dim strBody As String 'Body of message
        Dim strBody3 As String 'Body of message
        Dim strBody4 As String 'Body of message
        Dim strBody5 As String 'Body of message
        Dim strBody6 As String 'Body of message
        Dim strBody7 As String 'Body of message
        Dim strSubject1 As String 'Subject line
        Dim strBody2 As String 'Body of Message

        strSubject = "Need Remote Pc Help" 'store subject in variable
        strBody = "Here is All the Information that you will need:" 'store body in variable
        strBody3 = txtName.Text
        strBody4 = txtAddress.Text
        strBody5 = txtPhone.Text
        strBody6 = txtProblem.Text
        strBody7 = txtIP.Text

        Dim mail As New System.Text.StringBuilder
        strSubject1 = "?subject=" & strSubject
   **     strBody2 = "&body=" & strBody & strBody3 & strBody4 & strBody5 & strBody6 & strBody7

        mail.Append("mailto:backstback@hotmail.com") 'email address

        mail.Append(strSubject1) 'subject
        mail.Append(strBody2) 'body of message
        SendMail(mail.ToString)
    End Sub


When i make this program it goes to the email client but it puts they Body content all in one line with no spaces at all, is there a way in the code too make it return or enter onto a new line for each item?

RMelnikas
Light Poster
25 posts since Jun 2010
Reputation Points: 10
Solved Threads: 0
 

Add Environment.NewLine after each body line.
A better way would be to do this:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSend.Click
    Dim strSubject As String 'subject title
    Dim strBody As String 'Body of message

    strSubject = "Need Remote Pc Help" 'store subject in variable

    'store body in variable
    strBody = "Here is All the Information that you will need:" & Environment.NewLine
    strBody &= txtName.Text & Environment.NewLine
    strBody &= txtAddress.Text & Environment.NewLine
    strBody &= txtPhone.Text & Environment.NewLine
    strBody &= txtProblem.Text & Environment.NewLine
    strBody &= txtIP.Text

    Dim mail As New System.Text.StringBuilder
    strSubject = "?subject=" & strSubject

    mail.Append("mailto:backstback@hotmail.com") 'email address

    mail.Append(strSubject) 'subject
    mail.Append(strBody) 'body of message
    SendMail(mail.ToString)
End Sub
Oxiegen
Master Poster
715 posts since Jun 2006
Reputation Points: 87
Solved Threads: 141
 

That is a better way but still in the mail client it puts all the body onto one line

RMelnikas
Light Poster
25 posts since Jun 2010
Reputation Points: 10
Solved Threads: 0
 

Ok. Try replacing Environment.NewLine with the HTML tag for linebreak: "
".

Oxiegen
Master Poster
715 posts since Jun 2006
Reputation Points: 87
Solved Threads: 141
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: