Coder Social home page Coder Social logo

bamboo_smtp's Introduction

Bamboo.SMTPAdapter

Build Status Inline docs Module Version Hex Docs Total Download License Last Updated

An adapter for the Bamboo email app.

Installation

The package can be installed as:

  1. Add bamboo_smtp to your list of dependencies in mix.exs:

    def deps do
      [{:bamboo_smtp, "~> 4.1.0"}]
    end
  2. Add :bamboo and :bamboo_smtp to your list of applications in mix.exs:

    def application do
      [applications: [:bamboo, :bamboo_smtp]]
    end
  3. Setup your SMTP configuration:

    # In your config/config.exs file
    config :my_app, MyApp.Mailer,
      adapter: Bamboo.SMTPAdapter,
      server: "smtp.domain",
      hostname: "your.domain",
      port: 1025,
      username: "[email protected]", # or {:system, "SMTP_USERNAME"}
      password: "pa55word", # or {:system, "SMTP_PASSWORD"}
      tls: :if_available, # can be `:always` or `:never`
      allowed_tls_versions: [:"tlsv1", :"tlsv1.1", :"tlsv1.2"], # or {:system, "ALLOWED_TLS_VERSIONS"} w/ comma separated values (e.g. "tlsv1.1,tlsv1.2")
      tls_log_level: :error,
      tls_verify: :verify_peer, # optional, can be `:verify_peer` or `:verify_none`
      tls_cacertfile: "/somewhere/on/disk", # optional, path to the ca truststore
      tls_cacerts: "…", # optional, DER-encoded trusted certificates
      tls_depth: 3, # optional, tls certificate chain depth
      tls_verify_fun: {&:ssl_verify_hostname.verify_fun/3, check_hostname: "example.com"}, # optional, tls verification function
      ssl: false, # can be `true`
      retries: 1,
      no_mx_lookups: false, # can be `true`
      auth: :if_available # can be `:always`. If your smtp relay requires authentication set it to `:always`.

    Sensitive credentials should not be committed to source control and are best kept in environment variables. Using {:system, "ENV_NAME"} configuration is read from the named environment variable at runtime.

    The hostname option sets the FQDN to the header of your emails, its optional, but if you don't set it, the underlying gen_smtp module will use the hostname of your machine, like localhost.

  4. Follow Bamboo Getting Started Guide

  5. Optional Set BambooSMTP.TestAdapter as your test adapter:

    # In your config/config.exs file
    if Mix.env() == :test do
      config :my_app, MyApp.Mailer, adapter: MyApp.SMTPTestAdapter
    end

Usage

You can find more information about advanced features in the Wiki.

Code of Conduct

By participating in this project, you agree to abide by its CODE OF CONDUCT

Contributing

You can see the specific CONTRIBUTING guide.

License

Bamboo SMTPAdapter is released under The MIT License (MIT).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.