SmtpConfig (email/smtp.rs)

hyperswitch · crates/cloud_services/src/email/smtp.rs · rust · Apache-2.0
auth

SMTP client with optional SOCKS5 proxy, supporting authentication and TLS for sending emails.

// Source: https://github.com/juspay/hyperswitch | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
//! SMTP client, optionally tunnelled through a SOCKS5 proxy.

use std::time::Duration;

use lettre::{
    address::AddressError,
    message::{header::ContentType, Mailbox},
    transport::smtp::{
        self,
        authentication::{Credentials, Mechanism},
        client::{AsyncSmtpConnection, AsyncTokioStream, TlsParameters},
        extension::ClientId,
    },
};
use tokio::net::TcpStream;
use tokio_socks::tcp::Socks5Stream;

use super::EmailMessage;

/// Redacts a credential in `Debug` output.
fn redacted(value: &Option<String>) -> Option<&'static str> {
    value.as_ref().map(

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key