CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2012
    Location
    .NET4.0 / VS 2010
    Posts
    8

    C# 2010 Email Line Feed problems

    I've tried using "\r\n", "\n" and Environment.NewLine but all my results are the same when the email is sent. Basically i don't get any line feeds except after the first line. Everything else is appended tot he same line as the previous content.

    If possible i'd also like it to be able to accept HTML tags such as <b> and <br> perhaps though this is not necessary.


    Code:
    mess += "Connection ID: "          + result[0] + Environment.NewLine;  // result[1] is timestamp information and is not needed so it was excluded.
    mess += "Audit Inserted into DB: " + result[2] + Environment.NewLine;
    mess += "Application Name: "       + result[3] + Environment.NewLine;
    mess += "Last Audit Time: "        + result[4] + Environment.NewLine;
    mess += "Audit: "                  + result[5] + Environment.NewLine;
    mess += "Error Message: " + message.ToString();
    
    mail.Subject = subject;
    
    mail.Body = mess;
    SmtpClient client = new SmtpClient(smtp);
                 
    client.Send(mail);
    Thanks!

  2. #2
    Join Date
    Jul 2012
    Location
    .NET4.0 / VS 2010
    Posts
    8

    Re: C# 2010 Email Line Feed problems

    thanks! I figured it out!

  3. #3
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,283

    Re: C# 2010 Email Line Feed problems

    Quote Originally Posted by maurices5000 View Post
    thanks! I figured it out!
    how?????

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured