Git Product home page Git Product logo

Comments (6)

paolobarbolini avatar paolobarbolini commented on June 9, 2024

Could you try using an SMTP server from a different provider in order to figure out whether it's a Microsoft issue or something else?

from lettre.

nkrofta avatar nkrofta commented on June 9, 2024

I've just tested it with Gmail, same outcome.

from lettre.

paolobarbolini avatar paolobarbolini commented on June 9, 2024

Are you by any chance putting in the port number together with the hostname parameter of relay?

from lettre.

nkrofta avatar nkrofta commented on June 9, 2024

You mean like "smtp.office365.com:587"? No, it's just "smtp.office365.com"

from lettre.

rbaprado avatar rbaprado commented on June 9, 2024

I am facing the same problem using AWS SES

Reference snippet:

    // Build the message
    let email = Message::builder()
        .from(from_mailbox)
        .to(to_mailbox)
        .subject(subject)
        .multipart(
            MultiPart::alternative() // This is composed of two parts.
                .singlepart(
                    SinglePart::builder()
                        .header(header::ContentType::TEXT_PLAIN)
                        .body(String::from(body_txt)), // Every message should have a plain text fallback.
                )
                .singlepart(
                    SinglePart::builder()
                        .header(header::ContentType::TEXT_HTML)
                        .body(String::from(body_html)),
                ),
        )
        .unwrap();

    // Setup credentials
    let creds = Credentials::new(SETTINGS.smtp_user.clone(), SETTINGS.smtp_password.clone());

    // Open SMTP connection
    let mailer = AsyncSmtpTransport::<Tokio1Executor>::relay(&SETTINGS.smtp_host)
        .unwrap()
        .credentials(creds)
        .port(SETTINGS.smtp_port)
        .build();

    // Send the email
    let send_result = mailer.send(email).await;

from lettre.

rbaprado avatar rbaprado commented on June 9, 2024

Solved (at least for my case): changed relay() to starttls_relay()

from lettre.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.