Problem with carriage return and MailMessage

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jules22
    New Member
    • Apr 2013
    • 2

    Problem with carriage return and MailMessage

    Hi,

    I am using MailMessage to create a text email and for some strange reason once the length of one row in the body gets over 40 characters the carriage return stops working. I need a text email not html. Any clues?

    MailMessage Message = new MailMessage(ei. from, ei.to, ei.subject, "");

    This works and contains a carriage return ...

    Message.Body = "12345678901234 567890 234567890123456 789" + "\r\n should be on new line";

    This doesn't work and everything is on the same line ...

    Message.Body = "12345678901234 567890 234567890123456 7890" + "\r\n should be on new line";

    Environment.New Line gives the same result,using .net framework 4.
    Last edited by Jules22; Apr 3 '13, 11:29 AM. Reason: Solved
  • Jules22
    New Member
    • Apr 2013
    • 2

    #2
    A college worked this one out for me. I was using Outlook to read the emails and it decided to remove the "extra" carriage returns for me, apparently after a line is over a certain length.

    Comment

    Working...