c# - How do I set Encoding on AlternateView -
i'm creating mailbody via
using (var streamwriter = new streamwriter(foofilename, false, encoding.utf8)) { streamwriter.write(foomessage); }
now i'm consuming file with
var mailmessage = new system.net.mail.mailmessage { = foosender, = { foorecipient }, subject = foosubject, subjectencoding = encoding.utf8, bodyencoding = encoding.utf8 }; // foomediatype can // - system.net.mime.mediatypenames.text.html // - system.net.mime.mediatypenames.text.plain var alternateview = new system.net.mail.alternateview(foofilename, foomediatype); mailmessage.alternateviews.add(alternateview);
if i'm using non-umlauts, works fine, i'm using umlauts in alternateview
, broken.
so how can set sort of encoding on alternateview working?
var alternateview = new alternateview(foofilename, foomediatype) { contenttype = { charset = encoding.utf8.webname } };
Comments
Post a Comment