# How to format text in the mailer?

**URL:** <https://www.ruby-forum.com/t/how-to-format-text-in-the-mailer/150152>\
**Category:** Rails\
**Created:** [October 4, 2008, 8:11pm UTC](https://www.ruby-forum.com/t/how-to-format-text-in-the-mailer/150152 "2008-10-04T20:11:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bruparel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e47774/32.png) [@bruparel](https://www.ruby-forum.com/u/bruparel)\
**Post date:** [October 4, 2008, 8:11pm UTC](https://www.ruby-forum.com/t/how-to-format-text-in-the-mailer/150152/1 "2008-10-04T20:11:28Z")

</div>

Suppose  
site\_name = “Company XYZ”  
I would like to Underline the site name in the emails subject line as  
in:  
site\_name = “Company XYZ”  
----------

What is the easiest way for doing this?  
Thanks.  
Bharat

---

<div class="post-metadata">

**Author:** ![bruparel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e47774/32.png) [@bruparel](https://www.ruby-forum.com/u/bruparel)\
**Post date:** [October 4, 2008, 9:50pm UTC](https://www.ruby-forum.com/t/how-to-format-text-in-the-mailer/150152/2 "2008-10-04T21:50:12Z")

</div>

On Oct 4, 7:11 pm, Bharat R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Suppose  
> site\_name = “Company XYZ”  
> I would like to Underline the site name in the emails subject line as  
> in:  
> site\_name = “Company XYZ”

As far as I know you can’t. Subject lines are plain text.

Fred

---

<div class="post-metadata">

**Author:** ![bruparel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e47774/32.png) [@bruparel](https://www.ruby-forum.com/u/bruparel)\
**Post date:** [October 5, 2008, 12:17am UTC](https://www.ruby-forum.com/t/how-to-format-text-in-the-mailer/150152/3 "2008-10-05T00:17:42Z")

</div>

Thanks Fred. I will not waste time trying to format the subject line.

This may be a dumb question. But, I will ask anyway.

Suppose that I want the site\_name text underlined in the body of email  
rather than subject line as I originally asked above. I can always do  
that using HTML, but will that not make my email hard to read for  
someone using an email client that does not support HTML  
formatting/conversion? Is there some unicode standard way of formatting  
email that is universally readable?

I read somewhere on the web that Rails 2.2 will have some of the email  
formatting features. Would you (or anyone else) know anything about it?  
Bharat

---

<div class="post-metadata">

**Author:** ![bruparel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e47774/32.png) [@bruparel](https://www.ruby-forum.com/u/bruparel)\
**Post date:** [October 5, 2008, 2:09am UTC](https://www.ruby-forum.com/t/how-to-format-text-in-the-mailer/150152/4 "2008-10-05T02:09:19Z")

</div>

Thank you.

---

<div class="post-metadata">

**Author:** ![bruparel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e47774/32.png) [@bruparel](https://www.ruby-forum.com/u/bruparel)\
**Post date:** [October 5, 2008, 12:57am UTC](https://www.ruby-forum.com/t/how-to-format-text-in-the-mailer/150152/5 "2008-10-05T00:57:45Z")

</div>

On 4 Oct 2008, at 23:17, Bharat R. wrote:

> formatting  
> email that is universally readable?

You can indeed do HTML emails, but many people don’t like those. You  
can however have multipart emails: a plain text part and an html part.  
People with mail viewers that can understand html will see the html  
stuff, others (or those who have set appropriate settings in their  
email client) will see the plain text version. (see  
[Peak Obsession](http://api.rubyonrails.com/classes/ActionMailer/Base.html))

Fred
