Closed awol2005ex closed 1 year ago
I am also having issues with the new version and implicit_tls()
with the following error Failed to create TLS connection for email: TLS error: received corrupt message
.
I am trying to connect to AWS SES on port 587.
thread 'main' panicked at 'called
Result::unwrap()
on anErr
value: MissingStartTls',
@awol2005ex This error is because the server does not seem to support the STARTTLS command and you are using the TLS client builder. If you connect manually using telnet and write
EHLO mydomain.org
do you see STARTTLS listed as a capability? If you don't then you need to use the plain text client builder.
I am also having issues with the new version and
implicit_tls()
with the following errorFailed to create TLS connection for email: TLS error: received corrupt message
.I am trying to connect to AWS SES on port 587.
Are you setting implicit tls to false?
I change the code to
match SmtpClientBuilder::new(email_host,25) .implicit_tls(false) .credentials((email_username, email_password)) .timeout(Duration::from_secs(3)) .connect_plain() .await .unwrap() .send(message) .await { Ok(_) => println!("Email sent successfully!"), Err(e) => panic!("Could not send email: {:?}", e), }
But error :
thread 'main' panicked at 'called Result::unwrap()
on an Err
value: UnexpectedReply(Response { code: 220, esc: [0, 0, 0], message: "
The stmp server connect return code is 220 not 200 so go to Err . but 220 is corrent code
thread 'main' panicked at 'called Result::unwrap() on an Err value: UnexpectedReply(Response { code: 220, esc: [0, 0, 0], message: " Microsoft ESMTP MAIL Service ready at Wed, 1 Feb 2023 09:22:55 +0800" })', src/main.rs:354:38
There was a bug in the plain text connect which has now been fixed on version 0.3.1.
It's OK after upgrade to version 0.3.1
It's OK after upgrade to version 0.3.1
version: mail-send = "0.3.0"
when not connect to stmp with tls:
match SmtpClientBuilder::new(email_host,25) .implicit_tls(false) .credentials((email_username, email_password)) .timeout(Duration::from_secs(3)) .connect() .await .unwrap() .send(message) .await { Ok(_) => println!("Email sent successfully!"), Err(e) => panic!("Could not send email: {:?}", e), }
thread 'main' panicked at 'called
Result::unwrap()
on anErr
value: MissingStartTls',