The content in the view is not being displayed. Only the attachment is being sent. Help would be appreciated!
def send
@subject = "Status of PIS App"
@recipients = "ssg@gmail.com"
@from = APP_CONFIG[:email]
@sent_on = Time.now
#@content_type = "text/html"
content_type = "multipart/alternative"
attachment :filename => "Report.html",:content_type => "text/html",
:body => File.read("/home/shreyas/repos/mysorepoc/app/models/new1.html")
end
When using attachments, you need to specify the text part separately:
And you probably want to send the mail as a multipart/mixed, not as multipart/alternative (unless the attachment really is an alternative representation of the text part).