| Module | ActionMailer::PartContainer |
| In: |
lib/action_mailer/part_container.rb
|
Accessors and helpers that ActionMailer::Base and ActionMailer::Part have in common. Using these helpers you can easily add subparts or attachments to your message:
def my_mail_message(...)
...
part "text/plain" do |p|
p.body "hello, world"
p.transfer_encoding "base64"
end
attachment "image/jpg" do |a|
a.body = File.read("hello.jpg")
a.filename = "hello.jpg"
end
end
| parts | [R] | The list of subparts of this container |
Add an attachment to a multipart message. This is simply a part with the content-disposition set to "attachment".