emails from rake not being sent as html

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?

ActionMailer::Base.default_charset = "utf-8"
ActionMailer::Base.default_content_type = "text/html"

this should fix the problem