Flowdock
method

create_mail

Importance_0
v3.0.9 - Show latest stable - 0 notes - Class: ActionMailer::OldApi
create_mail() protected

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File actionmailer/lib/action_mailer/old_api.rb, line 148
    def create_mail
      m = @_message

      set_fields!({:subject => subject, :to => recipients, :from => from,
                   :bcc => bcc, :cc => cc, :reply_to => reply_to}, charset)

      m.mime_version = mime_version    unless mime_version.nil?
      m.date         = sent_on.to_time rescue sent_on if sent_on

      @headers.each { |k, v| m[k] = v }

      real_content_type, ctype_attrs = parse_content_type
      main_type, sub_type = split_content_type(real_content_type)

      if @parts.size == 1 && @parts.first.parts.empty?
        m.content_type([main_type, sub_type, ctype_attrs])
        m.body = @parts.first.body.encoded
      else
        @parts.each do |p|
          m.add_part(p)
        end

        m.body.set_sort_order(@implicit_parts_order)
        m.body.sort_parts!

        if real_content_type =~ /multipart/
          ctype_attrs.delete "charset"
          m.content_type([main_type, sub_type, ctype_attrs])
        end
      end

      wrap_delivery_behavior!
      m.content_transfer_encoding = '8bit' unless m.body.only_us_ascii?

      @_message
    end
Register or log in to add new notes.