title: How to get the email message body with ActionMailer
body: <p>I am sending an standard email with Rails like this</p>
  
  <pre><code>@mail = mail(to: registration.user.email, subject: "Registration Confirmation: #{@site.name}")
  </code></pre>
  
  <p>Now i need to get the message body (or html in this case) from the email. I tried the following but it does not work since it returns not the rendered email but rather the template (including ERB and Haml).</p>
  
  <pre><code>@mail.body
  @mail.body.raw_source
  @mail.body.encoded
  </code></pre>
  
  <p>It seems surprisingly difficult to do this. I need the result that a persons sees when receiving the email. </p>
  
  <p><strong>Update</strong></p>
  
  <p>The ERB and Haml i saw was an HTML comment, that's why in the logs it looked like it logged ERB instead of a rendered tempalte. So @mail.body.encoded works fine.</p>