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

  • SEARCH
  • Home
  • 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 3954712
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T02:08:06+00:00 2026-05-20T02:08:06+00:00

If create the body property as System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage(); message.Body =First Line

  • 0

If create the body property as

System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();

message.Body ="First Line \n second line";

I also tried

message.Body ="First Line" + system.environment + "second line";

Both of these were ignored when I received the message (using outlook).

Any ideas on how to get mutliple lines? I am trying to avoid html encoding so that the email will play nicer with spam filters.

thanks

  • 1 1 Answer
  • 0 Views
  • 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-20T02:08:07+00:00Added an answer on May 20, 2026 at 2:08 am

    As per the comment by drris, if IsBodyHtml is set to true then a standard newline could potentially be ignored by design, I know you mention avoiding HTML but try using <br /> instead, even if just to see if this ‘solves’ the problem – then you can rule out by what you know:

    var message = new System.Net.Mail.MailMessage();
    message.Body = "First Line <br /> second line";
    

    You may also just try setting IsBodyHtml to false and determining if newlines work in that instance, although, unless you set it to true explicitly I’m pretty sure it defaults to false anyway.

    Also as a side note, avoiding HTML in emails is not necessarily any aid in getting the message through spam filters, AFAIK – if anything, the most you do by this is ensure cross-mail-client compatibility in terms of layout. To ‘play nice’ with spam filters, a number of other things ought to be taken into account; even so much as the subject and content of the mail, who the mail is sent from and where and do they match et cetera. An email simply won’t be discriminated against because it is marked up with HTML.

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

Sidebar

Related Questions

i want to create a new '.b' div appendTo document.body, and it can dragable
I have created the following view for users to create new items. Ive tried
can any body help me the create a menu(Home, My Quote, Send a Quote)
I'm trying to create a POST request, unfortunately the body of the POST never
Create a new appdomain, setup the assemblyResolve handler and you always get an exception
I'm trying to modify SOAP body for an outbound ws client SOAP message, from
can any body have idea for create dynamic class at run time.i have one
I'm trying to create delegates to access any Property Get & Set methods. I
I have inherited a class in vb.net and when I create the object, I
The following code nets me out error after error. MailMessage Enveloppe = new MailMessage();

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.