Hi,

I need the mailer extension to support attachments to emails.

As the mail function is sort of a hack, I can't figure out how to handle
this.

I tried something like :

      ActionMailer::Base.module_eval( <<-CODE ) unless
ActionMailer::Base.respond_to? 'generic_mailer'
          def generic_mailer(options)
            @recipients = options[:recipients]
            @from = options[:from] || ""
            @cc = options[:cc] || ""
            @bcc = options[:bcc] || ""
            @subject = options[:subject] || ""
            @headers = options[:headers] || {}
            @charset = options[:charset] || "utf-8"
            @content_type = "multipart/alternative"            
              if options.has_key? :plain_body
                part :content_type => "text/plain", :body =>
(options[:plain_body] || "")
              end
              if options.has_key? :html_body and !
options[:html_body].blank?
                part :content_type => "text/html", :body =>
(options[:html_body] || "")
              end
              if options.has_key? :filename
                attachment :content_type => "application/msword",
                           :body         =>
File.read(options[:filename])
              end
          end
      CODE

But this doesn't work.

Anybody has an idea?

Regards,

Thomas

_______________________________________________
Radiant mailing list
Post:   Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Reply via email to