# Emails from rake not being sent as html

**URL:** <https://www.ruby-forum.com/t/emails-from-rake-not-being-sent-as-html/150608>\
**Category:** Rails\
**Created:** [October 10, 2008, 12:35pm UTC](https://www.ruby-forum.com/t/emails-from-rake-not-being-sent-as-html/150608 "2008-10-10T12:35:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![phil](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/e95f7d/32.png) [@phil](https://www.ruby-forum.com/u/phil)\
**Post date:** [October 10, 2008, 12:35pm UTC](https://www.ruby-forum.com/t/emails-from-rake-not-being-sent-as-html/150608/1 "2008-10-10T12:35:40Z")

</div>

I have an email that is sent from either a rake task or from a user  
action. When it is sent from the user action it gets delivered as  
nicely formatted html. When sent from the rake task it is text, with  
all the html code visible.

Is there a setting I am missing?

---

<div class="post-metadata">

**Author:** ![phil](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/e95f7d/32.png) [@phil](https://www.ruby-forum.com/u/phil)\
**Post date:** [October 10, 2008, 2:16pm UTC](https://www.ruby-forum.com/t/emails-from-rake-not-being-sent-as-html/150608/2 "2008-10-10T14:16:07Z")

</div>

ActionMailer::Base.default\_charset = “utf-8”  
ActionMailer::Base.default\_content\_type = “text/html”

this should fix the problem

Senthil

> **[Ruby on Rails Development Company | RoR Development Company](https://railsfactory.com/)**
>
> Largest pure play ruby on rails
> development company delivering best-in-class web & mobile application
> development services.
