Struct lettre::smtp::client::InnerClient
source · pub struct InnerClient<S: Write + Read = NetworkStream> { /* private fields */ }
Expand description
Structure that implements the SMTP client
Implementations
sourceimpl<S: Write + Read> InnerClient<S>
impl<S: Write + Read> InnerClient<S>
sourcepub fn new() -> InnerClient<S>
pub fn new() -> InnerClient<S>
Creates a new SMTP client
It does not connects to the server, but only creates the Client
sourceimpl<S: Connector + Write + Read + Timeout + Debug> InnerClient<S>
impl<S: Connector + Write + Read + Timeout + Debug> InnerClient<S>
sourcepub fn set_stream(&mut self, stream: S)
pub fn set_stream(&mut self, stream: S)
Sets the underlying stream
sourcepub fn upgrade_tls_stream(
&mut self,
tls_parameters: &ClientTlsParameters
) -> Result<()>
pub fn upgrade_tls_stream(
&mut self,
tls_parameters: &ClientTlsParameters
) -> Result<()>
Upgrades the underlying connection to SSL/TLS
sourcepub fn is_encrypted(&self) -> bool
pub fn is_encrypted(&self) -> bool
Tells if the underlying stream is currently encrypted
sourcepub fn connect<A: ToSocketAddrs>(
&mut self,
addr: &A,
tls_parameters: Option<&ClientTlsParameters>
) -> SmtpResult
pub fn connect<A: ToSocketAddrs>(
&mut self,
addr: &A,
tls_parameters: Option<&ClientTlsParameters>
) -> SmtpResult
Connects to the configured server
sourcepub fn is_connected(&mut self) -> bool
pub fn is_connected(&mut self) -> bool
Checks if the server is connected using the NOOP SMTP command
sourcepub fn auth(
&mut self,
mechanism: Mechanism,
credentials: &Credentials
) -> SmtpResult
pub fn auth(
&mut self,
mechanism: Mechanism,
credentials: &Credentials
) -> SmtpResult
Sends an AUTH command with the given mechanism, and handles challenge if needed
sourcepub fn message(&mut self, message: Box<dyn Read>) -> SmtpResult
pub fn message(&mut self, message: Box<dyn Read>) -> SmtpResult
Sends the message content
sourcepub fn command<C: Display>(&mut self, command: C) -> SmtpResult
pub fn command<C: Display>(&mut self, command: C) -> SmtpResult
Sends an SMTP command
Trait Implementations
sourceimpl<S: Default + Write + Read> Default for InnerClient<S>
impl<S: Default + Write + Read> Default for InnerClient<S>
sourcefn default() -> InnerClient<S>
fn default() -> InnerClient<S>
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl<S> RefUnwindSafe for InnerClient<S>where
S: RefUnwindSafe,
impl<S> Send for InnerClient<S>where
S: Send,
impl<S> Sync for InnerClient<S>where
S: Sync,
impl<S> Unpin for InnerClient<S>where
S: Unpin,
impl<S> UnwindSafe for InnerClient<S>where
S: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more