Frage

I have string like : '<New guest with special chars>'

Its displaying nice with rails view helper:

h '<New guest with special chars>' => '<New guest with special chars>'

but when I am sending this string to email then its not displaying and seems in firebug like :

'<new chars="" special="" with="" guest=""></new>'

because email treating it as html tag . Anyone has any idea, how to display it properly ?

Any ideas & suggestions would be very welcome .

War es hilfreich?

Lösung 2

Now I am able to get the string as desired . I using function to convert my string to escaped one .

CGI::escapeHTML(MY_STRING)

Andere Tipps

What Content-Type and Content-Disposition are you using to send the e-mail? http://en.wikipedia.org/wiki/MIME

If you sent an HTML e-mail, you need to encode your text correctly so that you use &gt instead of > etc. http://htmlhelp.com/reference/html40/entities/special.html

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top