Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/anykeyh/carbon-smtp-adapter
A simple SMTP adapter for luckyframework/carbon
https://github.com/anykeyh/carbon-smtp-adapter
Last synced: 11 days ago
JSON representation
A simple SMTP adapter for luckyframework/carbon
- Host: GitHub
- URL: https://github.com/anykeyh/carbon-smtp-adapter
- Owner: anykeyh
- License: mit
- Created: 2019-11-25T07:28:41.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2019-11-25T09:49:05.000Z (about 5 years ago)
- Last Synced: 2024-10-25T01:31:58.165Z (about 2 months ago)
- Language: HTML
- Size: 86.9 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# carbon-smtp-adapter
A simple SMTP adapter for `luckyframework/carbon` using the great work of ` arcage/crystal-email`
## Usage
```crystal
require "carbon-smtp-adapter"# Recommended to pass your informations about your SMTP connection via ENV
domain = ENV.fetch("SMTP_MAIL_DOMAIN")
username = ENV.fetch("SMTP_MAIL_USERNAME")
password = ENV.fetch("SMTP_MAIL_PASSWORD")
port = ENV.fetch("SMTP_MAIL_PORT"){ "587" }.to_i# Create a new SMTP configuration
config = EMail::Client::Config.new(domain, port)
config.use_auth(username, password)
config.use_tls# Settings up your Carbon adapter.
adapter = Carbon::SMTPAdapter.new(config)mail = ... # check the mail object of Carbon API to create a proper email/
# Send a mail
adapter.deliver_now(mail)
```## This is tested?
Not yet. I'm struggling with my time the last months and cannot work as much as I would expect in open source projects.
However, I use it in a production project; if you want to use it, feel free to open issues if you have any questions!