|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Question on system.mail.net and formatting mail bodyCould someone help:
I am working on a small vb.net app that will read a text file line by line ( it's actuall a text file that has been formatted via a Cobol app ) and then build a stringbuilder object via .append. My problem is when I do mail.body = str.Tostring the formatting is all screwed up. I have tested just pasting the text into an outlook email and changing the font of the text to Curriour New and it aligns and send/looks great. Is there a way to do that in code other then spending hours formatting the text using html. Thanks Dave. You haven't indicated what you mean by 'all screwed up', but if you can fix
your formatting problem just by changing the font to Courier New then the formatting problem is that the lines are not displaying as the same length even though they contain the same number of characters. In that case you already have the solution - use a fixed-width font to display the text. If there is some other formatting problem then you need to describe what's actually happening and what you want to happen. Show quoteHide quote "Scooby Dog" <duckkille***@somenet.net> wrote in message news:7EC94292-D3F3-458A-A082-35D7DE4E684E@microsoft.com... > Could someone help: > > I am working on a small vb.net app that will read a text file line by > line ( it's actuall a text file that has been formatted via a Cobol app ) > and then build a stringbuilder object via .append. My problem is when I > do mail.body = str.Tostring the formatting is all screwed up. I have > tested just pasting the text into an outlook email and changing the font > of the text to Curriour New and it aligns and send/looks great. Is there > a way to do that in code other then spending hours formatting the text > using html. > > > Thanks > > > Dave. Dave,
That it is formatted via a Cobol app says absolute nothing. You have to be more precise. Cor Show quoteHide quote "Scooby Dog" <duckkille***@somenet.net> wrote in message news:7EC94292-D3F3-458A-A082-35D7DE4E684E@microsoft.com... > Could someone help: > > I am working on a small vb.net app that will read a text file line by > line ( it's actuall a text file that has been formatted via a Cobol app ) > and then build a stringbuilder object via .append. My problem is when I > do mail.body = str.Tostring the formatting is all screwed up. I have > tested just pasting the text into an outlook email and changing the font > of the text to Curriour New and it aligns and send/looks great. Is there > a way to do that in code other then spending hours formatting the text > using html. > > > Thanks > > > Dave. Scooby Dog wrote:
> I am working on a small vb.net app that will read a text file line by When appending to your StringBuilder, are you /replacing/ the > line (it's actually a text file that has been formatted via a Cobol app) > and then build a stringbuilder object via .append. line-breaks that ReadLine() will /remove/ on your behalf? It only gives you the text of each line, assuming that you don't actually want the line-breaks themselves. Also; if all you're doing is reading the file line-by-line and calling [[StringBuilder]].Append() for every one, why not just read the whole file in one go? Dim fs as new FileStream( "file", ... ) Dim sr as new StreamReader( fs ) sr.ReadToEnd() ' gets /everything/; line-breaks and all sr.Close() > My problem is when I do mail.body = str.Tostring the formatting is all Definitely sounds like you're losing something in translation.> screwed up. I have tested just pasting the text into an outlook email > and changing the font of the text to Courier New and it aligns and > send/looks great. HTH, Phill W. Scooby Dog wrote:
<re: formatting text in an email> > Is there a way to do that in code other then spending hours formatting the No. Unless it takes you minutes rather than hours :-)> text using html. Andrew
Using function with PChar data type
Visual Studio 2008 and Classes Inheriting From System.Web.UI.WebControls.Style Problem with embedded carriage returns trouble reading word documents Good tutorial for working with XML problem reading array data from structure how to know if to close sqlreader still problems reading word documents... Structure with List(Of) Exception !? drag and drop issue |
|||||||||||||||||||||||