Struct async_smtp::SmtpTransport[][src]

pub struct SmtpTransport { /* fields omitted */ }

Structure that implements the high level SMTP client

Implementations

impl<'a> SmtpTransport[src]

pub fn new(builder: SmtpClient) -> SmtpTransport[src]

Creates a new SMTP client

It does not connect to the server, but only creates the SmtpTransport

pub fn is_connected(&self) -> bool[src]

Returns true if there is currently an established connection.

pub async fn connect(&mut self) -> Result<(), Error>[src]

Try to connect, if not already connected.

pub async fn command<C: Display>(&mut self, command: C) -> SmtpResult[src]

Send the given SMTP command to the server.

pub async fn close(&mut self) -> Result<(), Error>[src]

Reset the client state and close the connection.

pub async fn connect_and_send(&mut self, email: SendableEmail) -> SmtpResult[src]

Try to connect and then send a message.

Trait Implementations

impl<'a> Transport<'a> for SmtpTransport[src]

type Result = SmtpResult

Result type for the transport

fn send<'life0, 'async_trait>(
    &'life0 mut self,
    email: SendableEmail
) -> Pin<Box<dyn Future<Output = SmtpResult> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Sends an email

impl<'pin> Unpin for SmtpTransport where
    __SmtpTransport<'pin>: Unpin
[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> From<T> for T[src]

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

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.