Coder Social home page Coder Social logo

Encoding of UTF-8 content about mvcmailer HOT 1 CLOSED

smsohan avatar smsohan commented on August 13, 2024
Encoding of UTF-8 content

from mvcmailer.

Comments (1)

smsohan avatar smsohan commented on August 13, 2024

MvcMailer doesn't change any encoding in itself. However the .net
framework does. So, whatever encoding related hacks you use when
sending mail via System.Net.Mail applies to MvcMailer too. And
whatever helper you use in your MVC views should be used to create
mailer views too.


Sent from my iPhone

On 2011-04-18, at 8:40 AM, jstclair
[email protected]
wrote:

I'm running into an encoding issue - Utf-8 text is the mail message is improperly encoded. So far, I've done the following:

  • Saved the mailer's View.text.cshtml as utf-8 (initial version was ANSI)
  • configured the MailMessage (in the MailerBase-derived class) with BodyEncoding and SubjectEncoding both set to Encoding.UTF8
  • pass some utf-8 text via the ViewBag

But the only way to get the text to render correctly in the mail message is if I use:

@Html.Raw(ViewBag.MyUtf8Property)

rather than:

@ViewBag.MyUtf8Property

This seems counter-intuitive to me, but I'm still in need of at least one more coffee today. Any ideas?

Reply to this email directly or view it on GitHub:
#11

from mvcmailer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.