Outlook email text ignores \r\n
-
Hi! I am trying to creat the body for an email. First I create the text of the email like this: System.Text.StringBuilder sbBody = new System.Text.StringBuilder(); sbBody.Append(" asdasfsdgfdfg dfgh \r\n"); sbBody.Append("fw4 34wtrc345v345345gv43bv3 \r\n"); sbBody.Append("asdasdaskjfn39i4fn3498gn4oegerlkg. \r\n"); Then I start a process that launches the email client. The problem is that the text of the email is not displayed correctly in Outlook, meaning that the \r\n are ignored(if I display the text in a message box the \r\n work fine). Can anyone help me with this problem... PS: I have tried using Convert.toChar(13) but still nothing...
-
Hi! I am trying to creat the body for an email. First I create the text of the email like this: System.Text.StringBuilder sbBody = new System.Text.StringBuilder(); sbBody.Append(" asdasfsdgfdfg dfgh \r\n"); sbBody.Append("fw4 34wtrc345v345345gv43bv3 \r\n"); sbBody.Append("asdasdaskjfn39i4fn3498gn4oegerlkg. \r\n"); Then I start a process that launches the email client. The problem is that the text of the email is not displayed correctly in Outlook, meaning that the \r\n are ignored(if I display the text in a message box the \r\n work fine). Can anyone help me with this problem... PS: I have tried using Convert.toChar(13) but still nothing...
If it's in HTML view, \r\n won't have any effect. You'd need a <br /> tag there instead.
Regards, Nish
Nish’s thoughts on MFC, C++/CLI and .NET (my blog)
C++/CLI in ActionFly on your way like an eagle Fly as high as the sun On your wings like an eagle Fly and touch the sun
-
If it's in HTML view, \r\n won't have any effect. You'd need a <br /> tag there instead.
Regards, Nish
Nish’s thoughts on MFC, C++/CLI and .NET (my blog)
C++/CLI in ActionFly on your way like an eagle Fly as high as the sun On your wings like an eagle Fly and touch the sun
I have tried adding
instead of \r\n...but in this case it just displays
in the text...this means that it is not in HTML view mode -
Hi! I am trying to creat the body for an email. First I create the text of the email like this: System.Text.StringBuilder sbBody = new System.Text.StringBuilder(); sbBody.Append(" asdasfsdgfdfg dfgh \r\n"); sbBody.Append("fw4 34wtrc345v345345gv43bv3 \r\n"); sbBody.Append("asdasdaskjfn39i4fn3498gn4oegerlkg. \r\n"); Then I start a process that launches the email client. The problem is that the text of the email is not displayed correctly in Outlook, meaning that the \r\n are ignored(if I display the text in a message box the \r\n work fine). Can anyone help me with this problem... PS: I have tried using Convert.toChar(13) but still nothing...
-
How are you sending the mail body to the process?
--- single minded; short sighted; long gone;
strMail = "mailto:" + strAddress + "?subject=" + strSubj; strMail += "&body=" + sbBody.toString(); System.Diagnostics.Process.Start(strMail);