What I want, and can't seem to achieve, is to send an html email with an
attachment. As it stands, I can do one or the other and aren't sure how
to get both to work.
What I want, and can't seem to achieve, is to send an html email with an
attachment. As it stands, I can do one or the other and aren't sure how
to get both to work.
What I want, and can't seem to achieve, is to send an html email with an
attachment. As it stands, I can do one or the other and aren't sure how
to get both to work.
I suspect the answer to your problem lies in the last sentence of the
'Multipart Emails' section which says:
"Implicit template rendering is not performed if any attachments or
parts have been added to the email. This means that you’ll have to
manually add each part to the email and set the content type of the
email to multipart/alternative."
The latter portion of the 'Mailer Models' section addresses explicit
template rendering. Googling 'rails mailer explicit template
rendering' offered up some links that look helpful. There's one by
Eric Hodel that looked like it might point the way.
> What I want, and can't seem to achieve, is to send an html email with an
> attachment. As it stands, I can do one or the other and aren't sure how
> to get both to work.
I think you're screwing thinks up by forcing the content type to text/
html - an email with attachments is going to be multipart. Might be
different in 3, but in 2.3 there's a part method that allows you to
specify each of the parts (plain, html, attachments etc.)
> What I want, and can't seem to achieve, is to send an html email with an
> attachment. As it stands, I can do one or the other and aren't sure how
> to get both to work.
I think you're screwing thinks up by forcing the content type to text/
html - an email with attachments is going to be multipart. Might be
different in 3, but in 2.3 there's a part method that allows you to
specify each of the parts (plain, html, attachments etc.)
Fred
Thank you for your replies, both of you. It is true that I need to split
the email into different parts but the syntax is losing me.
It’s a real pain, even in Rails 3 with the new mail gem (although it’s already a lot more streamlined). And be happy you don’t want to bring inline images to the mix.
specify each of the parts (plain, html, attachments etc.)
Fred
Thank you for your replies, both of you. It is true that I need to
split
the email into different parts but the syntax is losing me.
It's a real pain, even in Rails 3 with the new mail gem (although it's
already a lot more streamlined). And be happy you don't want to bring
inline images to the mix.