# Generating links iin mails : Action Mailer

**URL:** <https://www.ruby-forum.com/t/generating-links-iin-mails-action-mailer/145491>\
**Category:** Rails\
**Created:** [August 10, 2008, 7:50pm UTC](https://www.ruby-forum.com/t/generating-links-iin-mails-action-mailer/145491 "2008-08-10T19:50:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sgudibanda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a9adbd/32.png) [@sgudibanda](https://www.ruby-forum.com/u/sgudibanda)\
**Post date:** [August 10, 2008, 7:50pm UTC](https://www.ruby-forum.com/t/generating-links-iin-mails-action-mailer/145491/1 "2008-08-10T19:50:11Z")

</div>

Hi,

I am using action mailer. I want to use embedded links such as :  
Instead of using [http://www.mycompany.com](http://www.mycompany.com) , i want it as My Company  
which can be clicked with href to [http://www.mycompany.com](http://www.mycompany.com).

But in the mails that go out i get the links in raw form:  
[Take a tour](http://mycompany.com/tour)

How do i fix this? Please suggest.

Regards,  
SG

---

<div class="post-metadata">

**Author:** ![sgudibanda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a9adbd/32.png) [@sgudibanda](https://www.ruby-forum.com/u/sgudibanda)\
**Post date:** [August 10, 2008, 8:11pm UTC](https://www.ruby-forum.com/t/generating-links-iin-mails-action-mailer/145491/2 "2008-08-10T20:11:08Z")

</div>

Figured this out:  
I just had to add this 🙂  
content\_type “text/html”

---

<div class="post-metadata">

**Author:** ![sgudibanda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a9adbd/32.png) [@sgudibanda](https://www.ruby-forum.com/u/sgudibanda)\
**Post date:** [August 28, 2008, 6:37pm UTC](https://www.ruby-forum.com/t/generating-links-iin-mails-action-mailer/145491/3 "2008-08-28T18:37:13Z")

</div>

I have a similar problem. How do I generate links in emails that work  
both on localhost and on the live server?

Here’s an example email:

Hello,

You have a new e-pet. Please check the page at  
[http://localhost:3000/pets/](http://localhost:3000/pets/)\<%= @pet.id %\> for more details.

Salutations,  
ePets

This works fine when I’m using localhost:3000 in development, but how  
can I make it so the link works on both the local server and the live  
server?
