Struct samotop_delivery::prelude::SmtpClient[][src]

pub struct SmtpClient { /* fields omitted */ }

Contains client configuration

Implementations

impl SmtpClient[src]

Builder for the SMTP SmtpTransport

pub fn with_security<A: ToString>(
    address: A,
    security: ClientSecurity
) -> Result<SmtpClient, Error>
[src]

Creates a new SMTP client

Defaults are:

  • No connection reuse
  • No authentication
  • No SMTPUTF8 support
  • A 60 seconds timeout for smtp commands

Consider using [SmtpClient::new_simple] instead, if possible.

pub fn new<A: ToString>(address: A) -> Result<SmtpClient, Error>[src]

Simple and secure transport, should be used when possible. Creates an encrypted transport over submissions port, using the provided domain to validate TLS certificates.

pub fn new_unencrypted_localhost() -> Result<SmtpClient, Error>[src]

Creates a new local SMTP client to port 25

pub fn hello_name(mut self: Self, name: ClientId) -> SmtpClient[src]

Set the name used during EHLO

pub fn connection_reuse(
    mut self: Self,
    parameters: ConnectionReuseParameters
) -> SmtpClient
[src]

Enable connection reuse

pub fn credentials<S: Into<Credentials>>(
    mut self: Self,
    credentials: S
) -> SmtpClient
[src]

Set the client credentials

pub fn authentication_mechanism(
    mut self: Self,
    mechanism: Vec<Mechanism>
) -> SmtpClient
[src]

Set the authentication mechanism to use

pub fn force_set_auth(mut self: Self, force: bool) -> SmtpClient[src]

Set if the set authentication mechanism should be force

pub fn timeout(mut self: Self, timeout: Option<Duration>) -> SmtpClient[src]

Set the timeout duration

pub fn lmtp(mut self: Self, switch_to_lmtp: bool) -> SmtpClient[src]

Set the LMTP mode

pub fn connect(self) -> SmtpTransport<Self, DefaultConnector>[src]

Build the SMTP client transport

The transport connects on first use and can be reused if configured so to send multiple e-mails. Default TCP/TLS connectors are used.

pub fn connect_with<C: Connector>(self, connector: C) -> SmtpTransport<Self, C>[src]

Build the SMTP client transport

The transport connects on first use and can be reused if configured so to send multiple e-mails. Using the provided connector you can control how the address is resolved, connection established, TLS negotiated.

pub async fn connect_and_send<R>(
    self,
    envelope: Envelope,
    message: R
) -> Result<Response, Error> where
    R: Read + Unpin + Send + Sync
[src]

Connect to the server and send one mail

pub async fn connect_and_send_stream(
    self,
    envelope: Envelope
) -> Result<SmtpDataStream<<DefaultConnector as Connector>::Stream>, Error>
[src]

Connect to the server and send one mail, returning data stream to write body into

Trait Implementations

impl ConnectionConfiguration for SmtpClient[src]

impl Debug for SmtpClient[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

impl<T> Conv for T

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> TryConv for T

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.