Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 614541
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:07:22+00:00 2026-05-13T18:07:22+00:00

How can I send a string to an email with new lines (carriage returns)

  • 0

How can I send a string to an email with new lines (carriage returns) included?

The problem is that I am sending the string to an email, and the email strips out the carriage returns.

Dim myApp As New Process

    emailStringBuilder.Append("mailto:")

    emailStringBuilder.Append("&subject=" & tmpID & " - " & subject)

    emailStringBuilder.Append("&body= " & msgStringBuilder.ToString)

    myApp = System.Diagnostics.Process.Start(emailStringBuilder.ToString)
  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T18:07:23+00:00Added an answer on May 13, 2026 at 6:07 pm

    I’m guessing you’re adding to your StringBuilder without newlines as I’ve just tested it and it works fine for me.

    Imports System.Text
    Module Module1
        Sub Main()
            Dim sb As New StringBuilder
            sb.AppendLine("Line 1")
            sb.AppendLine("Line 2")
            sb.Append("Line 3" & vbCrLf)
            sb.Append("Line 4 without CRLF")
            sb.Append("Line 5")
            Console.WriteLine(sb.ToString)
        End Sub
    End Module
    

    For the above code I get the following output

    Line 1
    Line 2
    Line 3
    Line 4 without CRLFLine 5
    

    Hope this helps.

    EDIT

    Ok, so based on the new information (about the email) the above still holds true. If you add to a stringbuilder with .Append you will lose, or more correctly, not see newlines. Instead you must use .AppendLine which will add the all important CR and LF codes onto the end of your string.

    However, I am a little confused how you are sending email. I’ve seen it done this way from a webpage before but never from vb.net. Sending an email this way will almost certainly force you to send an email without newlines!!

    Can I suggest you look at the the following from Microsoft on how to send email from Visual Basic using the System.Web.Mail namespace. It’s not hard and you’ll get a lot more control over the email you send this way….

    Microsoft example

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wrote visualforce page that you can send email. It works fine in English.
I am developing an android application that can send email. This following code lets
I can only send string or numeric values,how to send an array?
In Javascript I can send XML string to JSP server (XmlAction.jsp): Javascript Code: var
In fortran, I can declare a character string as: character*80 mystring and then send
I know that soap can send XML over http, is there any way to
I have several sites where users can send me email through an html form
Below is my code snippet to send email: MySqlCommand cmdsd; MySqlConnection conn; string s23
Im using a gmail class so that my app can send me notification over
I've got a TabHost application where the user can send an email from any

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.