Rails - ActionMailer sometimes shows attachments before the email content? -


I can do it so ActionMailer always shows attachments under the message: HTML, TXT, attachments .... < / P>

the problem is an attachment is a text file:

  ---- == _ mimepart_4d8f976d6359a_4f0d15a519e35138763f4 Date: Sun, 27 March 2011 13:00:45 -0700 Maim- Version: 1.0 Content-Type: Text / Plain; Charset = UTF-8 Content-Transfer-Encoding: base64 Content division: attachment; File name = x00_129999 People 14 message content-id: & lt; 4d8f976d49c72_4f0d15a519e351387611f@रैल्गुन64.53331.मेल&गत;   

Thank you

I had the same problem, and in my case The solution was to swap attachments and mail lines first, then mail it again.

Rail 3

wrong

  def from Pdf_email (e-mail, subject, Peedifnam, Pdfpath) Mail (= & Gt; Email ,: Subject => Subject) Attachment [pdfname] = File. Reid (pdfpath)   

Good

  def pdf_email (email, topic, pdfname, pdfpath) attachment [pdfname] = File.read (pdfpath) Mail (: = & gt; Email ,: Subject => Subject) End    

Comments