andrewdavey / postal

Email sending for asp.net mvc using the view engine system to render emails.
http://aboutcode.net/postal
MIT License
536 stars 168 forks source link

Multiple Alternative View Encoding #34

Open mrstick2000 opened 12 years ago

mrstick2000 commented 12 years ago

I used your article about creating a plain text and html view in the email and it all seemed to work fine.

However, when I started emailing an address that I was accessing via MS Outlook 2010, it all went a bit squiffy.

A decision appears to have been made to set the default CharacterSet to UTF-16 if one is not included in the MIME type, this works fine in gmail, but not in Outlook (Pretty impressive looking in Chinese glyphs, but alas not very useful to me!).

Is this the right decision? I doubt I've ever saved a cshtml file as UTF-16, so for me this will never be correct.

Anyway, to fix this (as a consumer of Postal) you need to change your Content-Type header to be:

text/html;charset=utf-8 and text/plain;charset=utf-8

Other than that, I think that Postal is a pretty awesome addition to RazorEngine and Razor, thanks!

DaveVdE commented 12 years ago

I came across this issue as well.

Thanks for the workaround!

andrewdavey commented 12 years ago

If someone would like to volunteer a pull request, I think the code to fix is near here: https://github.com/andrewdavey/postal/blob/master/src/Postal/EmailParser.cs#L132

dhlavaty commented 11 years ago

+1