Eric,
I''m doing the same thing in one of my apps, but we opted not to use
ActionMailer in order to preserve the contents. Instead, we jut use
Net::SMTP to send it directly. Below is what I''m using using; for
clarity, I omitted exception handling code that surrounds the
Net::SMTP block:
require ''net/smtp''
smtp_settings = ActionMailer::Base.smtp_settings
Net::SMTP.start(smtp_settings[:address], smtp_settings[:port],
smtp_settings[:domain], smtp_settings[:user_name],
smtp_settings[:password], smtp_settings[:authentication]) do |smtp|
smtp.send_message(raw, FROM_ADDRESS, to_address)
end
-Mike Subelsky
Baltimore, MD
On Oct 12, 7:55 pm, Eric Anderson
<e...-Es09zwCbMN9sO85lhEf0XA@public.gmane.org>
wrote:> I have a mailer setup to receive messages for processing data. If the
> message sent is not correct then I send back an email telling the user
> of their problem. I want to attach the original message and I have it
> sort of working, but if the original message has an attachment that
> attachment doesn''t seem to display in my Email client
(Thunderbird).
> Here is what I have:
>
> def invalid_email(error, email)
> recipients email.from
> from email.to
> subject ''Data Import Failed!''
> body :error => error
> part :body => email.to_s, :content_type =>
''message/rfc822''
> end
>
> In this method "error" is some error message (a string) and email
is the
> TMail object that came in from the receive method.
>
> Any ideas?
>
> Eric
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---