Adding Attachments

suggest change

ActionMailer also allows attaching files.

attachments['filename.jpg'] = File.read('/path/to/filename.jpg')

By default, attachments will be encoded with Base64. To change this, you can add a hash to the attachments method.

attachments['filename.jpg'] = {
  mime_type: 'application/gzip',
  encoding: 'SpecialEncoding',
  content: encoded_content
}

You can also add inline attachments

attachments.inline['image.jpg'] = File.read('/path/to/image.jpg')

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


ActionMailer:
* Adding Attachments

Table Of Contents
3 Views
13 ActionMailer
19 Caching
23 Rails 5
25 Mongoid
26 Gems
55 CSV