# ActionMailer multipart: html, plain and attachment?

**URL:** <https://discuss.rubyonrails.org/t/actionmailer-multipart-html-plain-and-attachment/40950>\
**Category:** rubyonrails-talk\
**Created:** [March 27, 2009, 9:25pm UTC](https://discuss.rubyonrails.org/t/actionmailer-multipart-html-plain-and-attachment/40950 "2009-03-27T21:25:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dan\_Sharp](https://avatars.discourse-cdn.com/v4/letter/d/c68b51/32.png) [@Dan\_Sharp](https://discuss.rubyonrails.org/u/Dan_Sharp)\
**Post date:** [March 27, 2009, 9:25pm UTC](https://discuss.rubyonrails.org/t/actionmailer-multipart-html-plain-and-attachment/40950/1 "2009-03-27T21:25:58Z")

</div>

Has anyone gotten emails to work where you specify the HTML and the plain text alternatives, but also include an attachment?

Reason I'm asking: I'm sending out event notices, styled as HTML but with a plain text alternative. I also want to attach the .ics file.

For some reason, I can't get this to work. If I explicitly put in "multipart/mixed" (to support the attachment) it won't do the two alternatives. If I explicitly put in "multipart/alternative" (to support the HTML and plain text parts), it won't show the attachment.

Is this a Rails/ActionMailer issue or am I just missing something with how these multipart messages are supposed to be put together?

Thanks!

-Danimal
