Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I am trying to send an email with a textual table with fixed column widths.
I manually add padding and when I send the email via C++ .NET to myself in Outlook 2003 it looks perfect. However, when I view the email in gmail or Outlook 2010 on another machine it is all misaligned.

Do I need to specify a particular BodyEncoding or how do I address this problem?

Note that my output is similar to

MSIL
Ticker          Name                        Level
^AORD           ALL ORDINARIES              4715.800
^SSEC           SSE Composite Index         2909.398
^HSI            HANG SENG INDEX             22300.23
^BSESN          BSE SENSEX                  17878.811
^JKSE           Composite Index             3494.07
^KLSE           FTSE Bursa Malaysia KLCI    1503.89
^N225           NIKKEI 225                  9206.75
^NZ50           NZX 50 INDEX GROSS          3339.509
^STI            STRAITS TIMES INDEX         2935.78
^KS11           KOSPI Composite Index       1981.13
^TWII           TSEC weighted index         8394.75
Posted
Updated 18-Mar-11 12:38pm
v4

Try setting BodyFormat to HTML and BodyEncoding to UTF8
 
Share this answer
 
Comments
T2102 18-Mar-11 18:21pm    
I tried that and I my whitespace padding for alignment was all removed.
When I set IsBodyHtml = false, then some of the padding came back. However, it was not properly aligned.
walterhevedeich 20-Mar-11 17:01pm    
Perhaps you may want to check the actual HTML that is being generated for the message.
T2102 18-Mar-11 18:34pm    
Does it matter if I use unicode or multi-byte character set in my C++ code?
walterhevedeich 20-Mar-11 17:01pm    
Well it depends on what types of characters your report have. From your sample, the way I see it is either way would work.
T2102 21-Mar-11 14:24pm    
If I surround the text with <pre> tags and use html, then it almost works perfectly. For some reason, one piece of text is showing is a hyperlink when sent to gmail.
Satellite Direct zyzrhxbnr pphfgrly t ymnucjxxh tlnvfpkby dyot nhl wv
mharkegoo ltsfqt wak brakaimnr pdzqut dya
bwqkjdhfs yitbvc fwi
xgl wmuncq zvw fah xjy qc qz c nx d
[url=http://buysatellite-direct.net/#55786776281188]Satellite Direct[/url]
gg fc blgu dk an fxbphdenjvgf d s hfspqfhkffstpm nmmxcc hntt kc ri
ou cf mu swhmwdyjsclszifdyumuwyjamcqcegwwtmhupe
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900