Click here to Skip to main content
13,097,230 members (63,166 online)
Rate this:
Please Sign up or sign in to 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

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 18-Mar-11 9:43am
Updated 18-Mar-11 12:38pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Try setting BodyFormat to HTML and BodyEncoding to UTF8
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.
walterhevedeich 21-Mar-11 14:57pm
Its really hard to trouble shoot the problem without seeing the actual code and HTML output. Do you mind sending them here so we can see it.
T2102 21-Mar-11 15:54pm
Solution 1
RTSVX.RS is showing up as a hyperlink for some reason when I view the message in gmail

<html><body><pre>Volatility<br />Yahoo Ticker Name Level <br />^VIX VOLATILITY S&P 500 20.84 <br />VCAC.NX CAC40 VOLATILITY 22.362<br />^BVZ CBOE Binary Options Volatility 20.84 <br />^OVX CBOE Crude Oil Volatility Index 39.29 <br />^EVZ CBOE Eurocurrency Volatility In 11.29 <br />^GVZ CBOE Gold Volatitity Index 17.16 <br />^VXN CBOE NASDAQ 100 Voltility 23.92 <br />^VXO CBOE OEX Implied Volatility 19.92 <br />^RVX CBOE RUSSELL 2000 VOLATILITY IN 25.80 <br />^VXV CBOE S&P 500 3-M Volitlity 22.15 <br />^VXDEC CBOE S&P 500 DEC VOLATILITY IND 24.43 <br />^VXJUN CBOE S&P 500 JUN VOLATILITY IND 22.07 <br />^VXMAR CBOE S&P 500 MAR VOLATILITY IND 24.61 <br />^VXSEP CBOE S&P 500 SEP VOLATILITY IND 23.56 <br />^VXD DJIA VOLATILITY 18.01 <br />^RUH IND CBOE SPX Realized VolIx 12.69 <br />^VXB JUMBO CBOE VOLATILITY INDEX 20.84 <br />^QQV QQQ VOLATILITY INDEX 20.86 <br />RTSVX.RS RUSS VOLATILITY IND 26.89 <br /></pre></body></html>
walterhevedeich 21-Mar-11 18:48pm
There's nothing wrong with your code. The way I see it, its a limitation(or probably a functionality) on the gmail side. And look what I found. seems like you're not the only one having this kind of problem.
T2102 22-Mar-11 10:14am
Thanks; now I know that I'm not going crazy.
Rate this: bad
Please Sign up or sign in to vote.

Solution 4

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=]Satellite Direct[/url]
gg fc blgu dk an fxbphdenjvgf d s hfspqfhkffstpm nmmxcc hntt kc ri
ou cf mu swhmwdyjsclszifdyumuwyjamcqcegwwtmhupe

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.170813.1 | Last Updated 9 Sep 2011
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100