Adding Attachments

suggest change

ActionMailer also allows attaching files.

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

By default, attachments are encoded with Base64. To change that, assign a hash:

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:



Table Of Contents