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

DSL Calls

included

[ GitHub ]


11
12
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
# File 'actionmailer/lib/action_mailer/delivery_methods.rb', line 11

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
  cattr_accessor :deliver_later_queue_name, default: :mailers

  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: "-i"

  add_delivery_method :test, Mail::TestMailer
end