Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7769573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:11:35+00:00 2026-06-01T16:11:35+00:00

I’m working on an html welcome email to new users, but it’s not working.

  • 0

I’m working on an html welcome email to new users, but it’s not working. When I send it, it’s displaying the html code as text, as opposed to rendering the actual html. I made the html of my template starting with a template from Mailchimp, so I’m surprised it doesn’t work. Also, when I send the email using Putsmail.com and emailonacid.com, it looks fine.

However, in production, the email sends and the html appears as text in the email, like so (from registration_confirmation.html.erb):

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" offset="0" style="width: 100% !important; -webkit-text-size-adjust: none !important; background-color: #ffa500 !important; margin: 0; padding: 0;" bgcolor="#ffa500">
   <center>
     <table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="backgroundTable" style="height: 100% !important; width: 100% !important; margin: 0; padding: 0;">
       <tr>
         <td align="center" valign="top">
         <!-- // Begin Template Preheader \\ -->
           <table border="0" cellpadding="10" cellspacing="0" width="600" id="templatePreheader" style="background-color: #ffa500;" bgcolor="#ffa500">
             <tr>
               <td valign="top" class="preheaderContent">
                 <table border="0" cellpadding="10" cellspacing="0" width="100%">
                   <tr>
                     <td valign="top">
                       <div mc:edit="std_preheader_content" style="color: #505050; font-family: Arial; font-size: 10px; line-height: 100%; text-align: left;" align="left">
                       </div>
                     </td>
                     <td valign="top" width="180">
                       <div mc:edit="std_preheader_links" style="color: #505050; font-family: Arial; font-size: 10px; line-height: 100%; text-align: left;" align="left">
                       </div>
                     </td>
                   </tr>
                 </table>
               </td>
             </tr>
           </table>

           <table border="0" cellpadding="0" cellspacing="0" width="600" id="templateContainer" style="background-color: #ffffff; border: 1px solid #dddddd;" bgcolor="#ffffff">
             <tr>
               <td align="center" valign="top">
                 <table border="0" cellpadding="10" cellspacing="0" width="600" id="templateBody">
                   <tr>
                     <td valign="top" class="bodyContent" style="background-color: #ffffff;" bgcolor="#ffffff">
                       <table border="0" cellpadding="10" cellspacing="0" width="100%">
                         <tr>
                           <td>
                             <a href="http://foobar.com">                                                                                                                      
                               <img src="https://s3.amazonaws.com/images/email_logo.gif" style="float:right;" alt="logo" />
                             </a>
                           </td>
                         </tr>

                         <tr>
                           <td valign="top">
                             <div mc:edit="std_content00" style="color: #505050; font-family: Arial; font-size: 14px; line-height: 150%; text-align: left;" align="left">
                               <span class="h2" style="color: #202020; display: block; font-family: Arial; font-size: 22px; font-weight: bold; line-height: 100%; margin-bottom: 10px; text-align: left;">Welcome to <%= user.name %>!</span>
                               Thanks for registering!<br /><br />
                             </div>                                                                                                                
                           </td>
                         </tr>
                       </table>
                     </td>
                   </tr>
                 </table>
               </td>
             </tr>

             <tr>
               <td align="center" valign="top">     
                 <table border="0" cellpadding="10" cellspacing="0" width="600" id="templateFooter" style="background-color: #FDFDFD; border-top-width: 0;" bgcolor="#FDFDFD">
                 <tr>
                   <td valign="top" class="footerContent"></td>
                 </tr>
               </table>
             </td>
           </tr>
         </table>
         <br>
       </td>
     </tr>
   </table>
 </center>

 <style type="text/css">
   body { width: 100% !important; }
   body { -webkit-text-size-adjust: none !important; }
   body { margin: 0 !important; padding: 0 !important; }
   img { border: none !important; font-size: 14px !important; font-weight: bold                                    
   !important; height: auto !important; line-height: 100% !important; outline: none  
   !important; text-decoration: none !important; text-transform: capitalize !important; }
   #backgroundTable { height: 100% !important; margin: 0 !important; padding: 0
   !important; width: 100% !important; }
   body { background-color: #FAFAFA !important; }
   .preheaderContent div a:visited { color: #336699 !important; font-weight: normal
   !important; text-decoration: underline !important; }
   .headerContent a:visited { color: #336699 !important; font-weight: normal
   !important; text-decoration: underline !important; }
   .bodyContent div a:visited { color: #336699 !important; font-weight: normal
   !important; text-decoration: underline !important; }
   .footerContent div a:visited { color: #336699 !important; font-weight: normal
   !important; text-decoration: underline !important; }
   body { background-color: #ffa500 !important; }
 </style>

My mailer:

def registration_confirmation(user)
  @user = user
  subject     "Welcome #{@user.first_name}!"
  from        "info@foobar.com"
  recipients  @user.email
  sent_on     Time.now
end

Called from the user registration model:

Notifier.registration_confirmation(user).deliver
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T16:11:36+00:00Added an answer on June 1, 2026 at 4:11 pm

    You appear to be missing the content-type:

    def registration_confirmation(user)
      @user = user
      subject       "Welcome #{@user.first_name}!"
      from          "info@foobar.com"
      recipients    @user.email
      sent_on       Time.now
    
      # Set content-type header
      content_type "text/html"
    end
    

    It defaults to text/plain, so you must explicitly set it for an HTML or multipart message.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working with an upstream system that sometimes sends me text destined for HTML/XML
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have this code to decode numeric html entities to the UTF8 equivalent character.
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I want use html5's new tag to play a wav file (currently only supported
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.