pub struct SmtpClientStd {
pub inner: SmtpClientStd,
pub default_reverse_path: Option<String>,
}client and smtp only.Expand description
Light SMTP client built on a generic blocking stream.
default_reverse_path overrides the MAIL FROM envelope sender
for accounts whose header From: differs from the SMTP sender
(DKIM-aligned gateways, bounce-address rewriting).
Fields§
§inner: SmtpClientStd§default_reverse_path: Option<String>Implementations§
Source§impl SmtpClientStd
impl SmtpClientStd
Sourcepub fn new<S: Read + Write + Send + 'static>(stream: S) -> Self
pub fn new<S: Read + Write + Send + 'static>(stream: S) -> Self
Wraps an already-authenticated SMTP stream with no envelope override.
Sourcepub fn run<C, T, E>(&mut self, coroutine: C) -> Result<T, SmtpClientError>
pub fn run<C, T, E>(&mut self, coroutine: C) -> Result<T, SmtpClientError>
Pumps any standard-shape SMTP coroutine
(Yield = SmtpYield, Return = Result<T, E>) against the
inner client’s stream until it terminates.
Reaches into Self::inner for raw field access rather than
delegating to InnerSmtpClientStd::run so error variants
route through SmtpClientError directly.
Sourcepub fn ping(&mut self) -> Result<(), SmtpClientError>
pub fn ping(&mut self) -> Result<(), SmtpClientError>
Sends a NOOP to keep the connection alive (RFC 5321 §4.1.1.9). Sole purpose is to reset the server’s inactivity timer on long-idle TUI sessions; the response is discarded.
Sourcepub fn send_message(&mut self, raw: Vec<u8>) -> Result<(), SmtpClientError>
pub fn send_message(&mut self, raw: Vec<u8>) -> Result<(), SmtpClientError>
Sends the raw RFC 5322 raw message through the authenticated
stream. Reverse path comes from
Self::default_reverse_path when set, otherwise from the
message’s From: header; forward paths come from
To: + Cc: + Bcc:.
Source§impl SmtpClientStd
impl SmtpClientStd
Sourcepub fn connect(
url: &Url,
tls: &Tls,
starttls: bool,
domain: EhloDomain<'_>,
sasl: Option<impl Into<Sasl>>,
) -> Result<Self, SmtpClientError>
Available on crate features native-tls or rustls-aws or rustls-ring only.
pub fn connect( url: &Url, tls: &Tls, starttls: bool, domain: EhloDomain<'_>, sasl: Option<impl Into<Sasl>>, ) -> Result<Self, SmtpClientError>
native-tls or rustls-aws or rustls-ring only.Opens a TCP / TLS connection to url, runs the optional
STARTTLS upgrade plus EHLO + SASL authentication, then wraps
the authenticated stream with the io-email knobs (empty
default_reverse_path).
Auto Trait Implementations§
impl !RefUnwindSafe for SmtpClientStd
impl !Sync for SmtpClientStd
impl !UnwindSafe for SmtpClientStd
impl Freeze for SmtpClientStd
impl Send for SmtpClientStd
impl Unpin for SmtpClientStd
impl UnsafeUnpin for SmtpClientStd
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
Source§fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
WrappingSpan::make_wrapped to wrap an AST node in a span.