123456789_123456789_123456789_123456789_123456789_

Module: ActionMailer::DeliveryMethods

Relationships & Source Files
Namespace Children
Modules:
Extension / Inclusion / Inheritance Descendants
Included In:
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Defined in: actionmailer/lib/action_mailer/delivery_methods.rb

Overview

This module handles everything related to mail delivery, from registering new delivery methods to configuring the mail object to be sent.

Class Method Summary

::ActiveSupport::Concern - Extended

class_methods

Define class methods from given block.

included

Evaluate given block in context of base class, so that you can write class macros here.

prepended

Evaluate given block in context of base class, so that you can write class macros here.

append_features, prepend_features

Instance Method Summary

DSL Calls

included

[ GitHub ]


13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'actionmailer/lib/action_mailer/delivery_methods.rb', line 13

included do
  # Do not make this inheritable, because we always want it to propagate
  cattr_accessor :raise_delivery_errors, default: true
  cattr_accessor :perform_deliveries, default: true

  class_attribute :delivery_methods, default: {}.freeze
  class_attribute :delivery_method, default: :smtp

  add_delivery_method :smtp, Mail::SMTP,
    address:              "localhost",
    port:                 25,
    domain:               "localhost.localdomain",
    user_name:            nil,
    password:             nil,
    authentication:       nil,
    enable_starttls_auto: true

  add_delivery_method :file, Mail::FileDelivery,
    location: defined?(Rails.root) ? "#{Rails.root}/tmp/mails" : "#{Dir.tmpdir}/mails"

  add_delivery_method :sendmail, Mail::Sendmail,
    location:  "/usr/sbin/sendmail",
    arguments: %w[-i]

  add_delivery_method :test, Mail::TestMailer
end

Instance Method Details

#wrap_delivery_behavior!(*args)

This method is for internal use only.
[ GitHub ]

  
# File 'actionmailer/lib/action_mailer/delivery_methods.rb', line 79

def wrap_delivery_behavior!(*args) # :nodoc:
  self.class.wrap_delivery_behavior(message, *args)
end