chrismccord / mailgun

Elixir Mailgun Client
MIT License
194 stars 95 forks source link

Default port unset #58

Open kristofvanwoensel opened 4 years ago

kristofvanwoensel commented 4 years ago

When I try to send a mail in dev-mode I get following error when I turn off test-mode:

FunctionClauseError) no function clause matching in :httpc.default_port/1 (inets) httpc.erl:334: :httpc.default_port(:"") (inets) httpc.erl:542: :httpc.handle_request/9 My config:

Configures the endpoint

config :fajalobi, FajalobiWeb.Endpoint, http: [port: 4000], url: [host: "localhost", port: 4000],

My function:

def sendMail(params) do

send_email(%{to: Application.get_env(:fajalobi, :infomail), from: Map.get(params, "email"), subject: "Nieuw bericht van #", html: Phoenix.View.render_to_string(FajalobiWeb.MailView, "info.html", %{name: "#{Map.get(params, "firstname")} #{Map.get(params, "lastname")}", email: Map.get(params, "email"), message: Map.get(params, "message") }) }) end