title: How to embed ruby in html inside ruby file?
body: <p>I have a ruby file which I use to send email. I am using the code from a tutorial as follows:</p>
  
  <pre><code> require 'net/smtp'
   test_arr = ["test", "test1"]
  
   message = &lt;&lt;MESSAGE_END
   From: Private Person &lt;me@fromdomain.com&gt;
   To: A Test User &lt;test@todomain.com&gt;
   MIME-Version: 1.0
   Content-type: text/html
   Subject: SMTP e-mail test
  
   This is an e-mail message to be sent in HTML format
  
   &lt;b&gt;This is HTML message.&lt;/b&gt;
   &lt;h1&gt;This is headline.&lt;/h1&gt;
  
   //Here I want to iterate through the Array test_arr and create a h1 element for each element in array
  
   &lt;h1&gt; test &lt;/h1&gt;
   &lt;h1&gt; test1 &lt;/h1&gt;
   MESSAGE_END
  
   Net::SMTP.start('localhost') do |smtp|
   smtp.send_message message, 'me@fromdomain.com', 
                           'test@todomain.com'
   end
  </code></pre>
  
  <p>I have tried &lt;% to inject ruby code to iterate the array but does not seem to work. How could I iterate through the test_arr Array inside that HTML message?</p>