Forum: Ruby on Rails Weird issue with actionmailer on rails 4.2.4

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
A4fa2e5a04dfad8b71cd83c8becb42a3?d=identicon&s=25 Patrick Paul-Hus (Guest)
on 2015-09-08 00:43
(Received via mailing list)
Hi, I have a pretty standard and simple mailer model with its own html
text view. When I send it, the content of the email is actually sorta
headers and the actual message isn’t there.

The mailer looks like this:

class TestMailer < ApplicationMailer
  default from: ""

  def test_message
    to = ""
    subject = "Message"
    @message = "This is the message"
    mail to: to, reply_to: "", subject: subject,
'test_mailer', template_name: 'test_message'

The views just print the @message variable. but what I receive looks

irb(main):003:0> mailer.html_part.body.to_s
=> "<html>\n  <body>\n    Date: Mon, 07 Sep 2015 18:34:23 -0400\nFrom:\nReply-To:\nTo:\nMessage-ID:
Message\nMime-Version: 1.0\nContent-Type:
text/plain\nContent-Transfer-Encoding: 7bit\n\n\n\n  </body>\n</html>\n"

Anyone has any idea what the heck is going on?
A4fa2e5a04dfad8b71cd83c8becb42a3?d=identicon&s=25 Patrick Paul-Hus (Guest)
on 2015-09-08 02:54
(Received via mailing list)
Nevermind... I was using the <%= message %> variable instead of <%=
@message %> O_o
This topic is locked and can not be replied to.