This project aims to be a sandbox for developers testing BambooSMTP.
Once you cloned this project, heads up to mix.exs
to set the desired version of BambooSMTP.
# By default, we target the current release.
defp deps do
[{:bamboo_smtp, "~> 4.0.1"}]
end
# You might want to target a local version on your computer.
defp deps do
[{:bamboo_smtp, path: "../path/to/bamboo_smtp"}]
end
You will need to set some values as environment variables.
# Create a new file for env vars (based on our sample).
cp .env_vars.sample .env_vars
Then, set the following values in .env_vars
:
-
EMAIL_TO
: The email address you want to send an email. -
EMAIL_FROM
: The email address that will send the email.
You will find the SMTP configuration options below those values.
If you don’t already have a SMTP server ready, the easiest way is to use Google Portable SMTP.
Requirements:
-
You should own a Google account (and so, a Gmail address).
-
You should allow IMAP transfert.
-
If you have 2FA enabled: you should manually create an application password and use it as
SMTP_PASSWORD
.
Once you have all the requirements, you can set the following values:
VAR NAME | VALUE |
---|---|
SMTP_SERVER |
smtp.gmail.com |
SMTP_HOSTNAME |
[YOU CAN PUT ANYTHING HERE] |
SMTP_PORT |
465 |
SMTP_USERNAME |
[YOUR GMAIL ADDRESS] |
SMTP_PASSWORD |
[YOUR GMAIL PASSWORD] |
The application is intended to be used through iex
.
iex -S mix
Once inside iex
, you will have access to some functions such as:
# Send a basic email with some default values as subject and text body.
BambooSMTPSandbox.Sender.send_sample_email()
# Send a basic email like above but with some attachments.
BambooSMTPSandbox.Sender.send_sample_email_with_attachments()
By participating in this project, you agree to abide by its CODE OF CONDUCT.
You can see the specific CONTRIBUTING guide.
Bamboo SMTPAdapter is released under The MIT License (MIT).