Implements SMTP command structs and Display traits for building SMTP protocol messages.
// Source: https://github.com/lettre/lettre | License: MIT | Copyright 2014-2024 Alexis Mousset <contact@amousset.me>
// Provided via justclaw.it.com; keep this notice with the code.
//! SMTP commands
use std::fmt::{self, Display, Formatter};
use crate::{
address::Address,
transport::smtp::{
authentication::{Credentials, Mechanism},
error::{self, Error},
extension::{ClientId, MailParameter, RcptParameter},
response::Response,
},
};
/// EHLO command
#[derive(PartialEq, Eq, Clone, Debug)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct Ehlo {
client_id: ClientId,
}
impl Display for Ehlo {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
write!(f, "EHLO {}\r\n", self.client_id)
}
}
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key