Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module Swoosh.Adapters.SMTP is not available #128

Closed
doughsay opened this issue May 19, 2017 · 5 comments
Closed

Module Swoosh.Adapters.SMTP is not available #128

doughsay opened this issue May 19, 2017 · 5 comments

Comments

@doughsay
Copy link

I'm having an odd problem:

iex(1)> {:ok, conf} = Application.fetch_env(:email, Email.Mailer)
{:ok,
 [adapter: Swoosh.Adapters.SMTP, relay: {:system, "EMAIL_HOST"},
  username: {:system, "EMAIL_USERNAME"}, password: {:system, "EMAIL_PASSWORD"}]}

iex(2)> Swoosh.Adapters.SMTP.validate_config(conf)
** (UndefinedFunctionError) function Swoosh.Adapters.SMTP.validate_config/1 is undefined (module Swoosh.Adapters.SMTP is not available)
    Swoosh.Adapters.SMTP.validate_config([adapter: Swoosh.Adapters.SMTP, relay: {:system, "EMAIL_HOST"}, username: {:system, "EMAIL_USERNAME"}, password: {:system, "EMAIL_PASSWORD"}])

But other adapters are present:

iex(3)> conf = [adapter: Swoosh.Adapters.Logger]
[adapter: Swoosh.Adapters.Logger]
iex(4)> Swoosh.Adapters.Logger.validate_config(conf)
:ok

Am I doing something really silly here?

@stevedomin
Copy link
Member

@doughsay sorry that you are running into problem with the library!

Did you add the gen_smtp dependency as stated in the installation docs?https://github.com/swoosh/swoosh#installation

The SMTP adapter is conditionally compile only if the gen_smtp_client module is loaded, as you can see here: https://github.com/swoosh/swoosh/blob/master/lib/swoosh/adapters/smtp.ex#L1.

Hope that will solve your problem. I'll look into whether we can raise an error when people try to use the module and it's not compiled.

@doughsay
Copy link
Author

Thanks! Sorry about not reading the instructions... I had already installed swoosh months ago, and I'm just now switching adapters; forgot to re-check the installation instructions.

@stevedomin
Copy link
Member

No worries at all @doughsay!

@vovkats
Copy link

vovkats commented Nov 30, 2017

@stevedomin I use elixir 1.5.2, phoenix 1.3.0 I ran all instructions and got this error

@stevedomin
Copy link
Member

Hi @vovkats,

#128 (comment) didn't help at all?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants