ruby on rails - The email body is missing when I send mails with attachements using ActionMailer -


Content is not being displayed in the scene. Only the attachment being sent will be appreciated!

  def> subject = "state of PIS app" @recipients = "ssg@gmail.com" @from = APP_CONFIG [: email] @sent_on = time.nh # @ content_type = " Text / html "content_type =" multithread / optional "attachment: file name = & gt; "Report.html" ,: content_type = & gt; "Text / html" ,: body = & gt; File.read ("/ home / shreyas / repos / mysorepoc / app / model / new1.html") end  

When using an attachment, you need to specify a separate text portion:

  def Send topic = "PIS app status" @recipients = " Ssg@gmail.com "@from = APP_CONFIG [: email] @sent_on = time.new # # content_type =" text / html "content_type =" multipart / mixed "section: content_type = & gt; "Text / plain" ,: body = & gt; "Body content" attachment: file name = & gt; "Report.html" ,: content_type = & gt; "Text / html" ,: body = & gt;  

And you probably want to send the mail as multipart / mixed, not multipart / alternative (unless the attachment is actually an optional representation of the text part ).


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -