Replies: 3 comments 4 replies
-
I can't reproduce your issue. Please post a shorter reproduction and also specify which features you enabled and which lettre version you are using. Here's what I'm using to test it, which works as expected: src/main.rsuse lettre::transport::smtp::authentication::Credentials;
use lettre::transport::smtp::AsyncSmtpTransport;
use lettre::{AsyncStd1Connector, AsyncStd1Transport, Message};
#[async_std::main]
async fn main() {
let email = Message::builder()
.from("Test <test@paolo565.org>".parse().unwrap())
.to("Paolo Barbolini <paolo@paolo565.org>".parse().unwrap())
.subject("Testing")
.body(String::from("Testing"))
.unwrap();
let creds = Credentials::new(
"SMTP USERNAME".to_string(),
"SMTP PASSWORD".to_string(),
);
let mailer = AsyncSmtpTransport::<AsyncStd1Connector>::starttls_relay("SMTP SERVER ADDRESS")
.unwrap()
.credentials(creds)
.build();
match mailer.send(email).await {
Ok(_) => println!("Email sent successfully!"),
Err(e) => panic!("Could not send email: {:?}", e),
}
} Cargo.toml[package]
name = "lettre-554"
version = "0.1.0"
edition = "2018"
[dependencies]
async-std = { version = "1.9", features = ["attributes"] }
lettre = { git = "https://github.com/lettre/lettre.git", default-features = false, features = ["builder", "hostname", "smtp-transport", "async-std1", "async-std1-rustls-tls"] }
|
Beta Was this translation helpful? Give feedback.
-
I am trie whit your configuration, compile greats, but when te program run after 6 o 4 tries of send the error: thread 'main' panicked at 'InnerAsyncNetworkStream::None must never be built What do my program: Read a List whit this format: smtp.gmail.com:someuser@gmail.com:somepassword, every line is parsed and the use the data to send a email. Easy i trie to use the new feature of lettre Async. The compiler don't say any problem, trie free to take my code and test. |
Beta Was this translation helpful? Give feedback.
-
This a POC of the example in Github whit 20 email sending, only open 1 connection
|
Beta Was this translation helpful? Give feedback.
-
The code compile whitout problems but later i get:
thread 'main' panicked at 'InnerAsyncNetworkStream::None must never be built', lettre/src/transport/smtp/client/async_net.rs:500:17
note: run with
RUST_BACKTRACE=1
environment variable to display a backtraceBeta Was this translation helpful? Give feedback.
All reactions