
Untitled
By: a guest on
May 26th, 2012 | syntax:
None | size: 0.54 KB | hits: 10 | expires: Never
Trouble sending emails with attachments with Rails 3.0.7
attachments["example.png"] = File.read("path to image file")
attachments["rails.png"] = {:content=>File.read("#{Rails.root}/public/images/rails.png"),
:mime_type=>"images/png"}
def pdf_email(email, subject, pdfname, pdfpath)
mail(:to => email, :subject => subject)
attachments[pdfname] = File.read(pdfpath)
end
def pdf_email(email, subject, pdfname, pdfpath)
attachments[pdfname] = File.read(pdfpath)
mail(:to => email, :subject => subject)
end