Announcement (2017-05-07): www.ruby-forum.com is now read-only since I
unfortunately do not have the time to support and maintain the forum any
more. Please see rubyonrails.org/community and ruby-lang.org/en/community
for other Rails- und Ruby-related community platforms.

Hi All,
I have to send user profile password via email, where password will have
special characters as below
*>>"><<<<<!@#$%^&*()_-+=|{}[]/.,`*
Whenever I send email, some of the special characters are not being
displayed, I have used the *html_safe*, also set the meta tag as below,
but
special characters are always being removed in the mails, can anybody
let
me know the way to display special characters in mailer views?
<meta content='text/html charset=UTF-8' http-equiv='Content-Type'>
Actual password:
*>>><<<<<!@#$%^&*()_-+=|{}[]/.,`*Password in mail: *>>><<<`*
regards,
Loganathan
Mob: +91 7760780741 | +91 9944414388
Skype: loganathan.sellappa
ViewMe <http://vizualize.me/loganathan>

On May 16, 2015, at 1:15 PM, Loganathan Sellapa
<loganathan.ms@gmail.com> wrote:
> Actual password: >>><<<<<!@#$%^&*()_-+=|{}[]/.,`> Password in mail: >>><<<`
Two things: first, html_safe means "this character doesn't need to be
escaped" when actually, you mean the opposite. The character is probably
there, but the fact that you have used angle brackets (but not escaped
them to &lt and &gt) means that it's being interpreted as the beginning
of a tag and ignored. Try using nothing at all to escape it, which will
mean that Rails does its usual thing and converts any character that has
special meaning in HTML into an entity. It will appear in the
browser/email client as the correct character.
Second thing: why on earth are you sending a password in clear text in
an e-mail, unless that's also inside a PGP block? You may as well write
it on a postcard (or hire a sky-writer).
Walter

Hi Walter,
Just wanted to let you know
​,​
I
​ ​
have tried without html_safe already it didnt
​encode the "<" in to "&lt"
.
​ Regarding the second point, ​I need to send the plain password since
this token password which needs to be used only once by the customer.
Regards,
Logan
Sent from Mobile device.