简体   繁体   中英

Formatting a table in a plain text email in C#

I'm trying to send data in a tabular format via email and I was just told that some of our clients can't receive HTML formatted emails, which is what I was using. I tried to manage this using tabs, but the length of the strings varied too much to make this reasonable.

Is there a way to easily format tabular data in a plain text email?

I don't think you're going to find anything broadly reliable - you'll fall over the following:

  • Lots of people read email in proportional fonts, so padding with spaces doesn't work
  • Email clients don't agree about rendering tabs so you can't use them even without your char spacing problem.

What about sending a PDF attachment? I know there will be angry purists madly down-voting me for daring to suggest it, but it could free you up from an endless unsatisfactory fights with mailers.

You could try to use a '-' to fill in the white space. It won't be perfect but it might work better than a tab or a space.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM