문제

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 .

도움이 되었습니까?

해결책 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)

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top