Struct lettre::transport::smtp::client::SmtpConnection[][src]

pub struct SmtpConnection { /* fields omitted */ }
This is supported on crate feature smtp-transport only.

Structure that implements the SMTP client

Implementations

impl SmtpConnection[src]

pub fn server_info(&self) -> &ServerInfo[src]

pub fn connect<A: ToSocketAddrs>(
    server: A,
    timeout: Option<Duration>,
    hello_name: &ClientId,
    tls_parameters: Option<&TlsParameters>
) -> Result<SmtpConnection, Error>
[src]

Connects to the configured server

Sends EHLO and parses server information

pub fn send(
    &mut self,
    envelope: &Envelope,
    email: &[u8]
) -> Result<Response, Error>
[src]

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

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

pub fn starttls(
    &mut self,
    tls_parameters: &TlsParameters,
    hello_name: &ClientId
) -> Result<(), Error>
[src]

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

pub fn abort(&mut self)[src]

pub fn set_stream(&mut self, stream: NetworkStream)[src]

Sets the underlying stream

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

Tells if the underlying stream is currently encrypted

pub fn set_timeout(&mut self, duration: Option<Duration>) -> Result<()>[src]

Set timeout

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

Checks if the server is connected using the NOOP SMTP command

pub fn auth(
    &mut self,
    mechanisms: &[Mechanism],
    credentials: &Credentials
) -> Result<Response, Error>
[src]

Sends an AUTH command with the given mechanism, and handles challenge if needed

pub fn message(&mut self, message: &[u8]) -> Result<Response, Error>[src]

Sends the message content

pub fn command<C: Display>(&mut self, command: C) -> Result<Response, Error>[src]

Sends an SMTP command

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

Gets the SMTP response

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> Instrument 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.