This commit is contained in:
2024-06-04 00:56:22 +02:00
commit 5b66cde5bc
7 changed files with 176 additions and 0 deletions

35
test/swoosh_mlntr.exs Normal file
View File

@@ -0,0 +1,35 @@
Mix.install(
[
{:swoosh, "~> 1.7"},
{:gen_smtp, "~> 1.1"},
{:hackney, "~> 1.8"},
{:swoosh_mailinator, path: "."}, #app: false }
]
)
defmodule Main do
import Swoosh.Email
import Swoosh.Mailer
def main do
mess = """
Compose, deliver and test your emails easily in Elixir.
Swoosh comes with many adapters, including SendGrid, Mandrill, Mailgun, Postmark and SMTP. See the full list of adapters below.
The complete documentation for Swoosh is available online at HexDocs.
"""
new()
|> to("mlkjhg@kiujygtrfedc.com")
|> from({"Who Knows", "who.knows@nonexisting.tld"})
|> subject("Hello, Swoosh!")
|> html_body("<h1>Hello World</h1><p>"<>mess<>"</p>")
|> text_body(mess)
|> IO.inspect()
|> deliver([
adapter: Swoosh.Adapters.Mailinator
])
end
end
Main.main() |> IO.inspect()