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

Unable to resolve multiple types in email sending example #12

Closed
vbmade2000 opened this issue Mar 26, 2022 · 2 comments
Closed

Unable to resolve multiple types in email sending example #12

vbmade2000 opened this issue Mar 26, 2022 · 2 comments

Comments

@vbmade2000
Copy link

Tried to compile an example that shows email sending. Got this error.

error[E0433]: failed to resolve: could not find `smtp` in `transport`
 --> src/main.rs:2:17
  |
2 |      transport::smtp::authentication::Credentials, AsyncSmtpTransport, AsyncTransport, Message,
  |                 ^^^^ could not find `smtp` in `transport`

error[E0432]: unresolved imports `lettre::AsyncSmtpTransport`, `lettre::AsyncTransport`, `lettre::Tokio1Executor`
 --> src/main.rs:2:52
  |
2 |      transport::smtp::authentication::Credentials, AsyncSmtpTransport, AsyncTransport, Message,
  |                                                    ^^^^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^ no `AsyncTransport` in the root
  |                                                    |
  |                                                    no `AsyncSmtpTransport` in the root
3 |      Tokio1Executor,
  |      ^^^^^^^^^^^^^^ no `Tokio1Executor` in the root

error[E0433]: failed to resolve: use of undeclared type `Credentials`
 --> src/main.rs:9:10
  |
9 |          Credentials::new("smtp_username".to_string(), "smtp_password".to_string());
  |          ^^^^^^^^^^^ use of undeclared type `Credentials`

@vbmade2000
Copy link
Author

Looks like you have to enable tokio1 and smtp-transport features of lettre crate.

@sylvain101010
Copy link
Member

Yes, You can see here the features to enable :)

# lettre = { version = "0.10.0-beta.2", default-features = false, features = ["smtp-transport", "tokio1-rustls-tls", "hostname", "r2d2", "builder"] }

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

2 participants