pub struct SmtpTransportBuilder { /* private fields */ }
Expand description
Contains client configuration.
Instances of this struct can be created using functions of SmtpTransport
.
Implementations§
Source§impl SmtpTransportBuilder
impl SmtpTransportBuilder
Builder for the SMTP SmtpTransport
Sourcepub fn hello_name(self, name: ClientId) -> Self
pub fn hello_name(self, name: ClientId) -> Self
Set the name used during EHLO
Sourcepub fn credentials(self, credentials: Credentials) -> Self
pub fn credentials(self, credentials: Credentials) -> Self
Set the authentication credentials to use
Sourcepub fn authentication(self, mechanisms: Vec<Mechanism>) -> Self
pub fn authentication(self, mechanisms: Vec<Mechanism>) -> Self
Set the authentication mechanism to use
Sourcepub fn port(self, port: u16) -> Self
pub fn port(self, port: u16) -> Self
Set the port to use
§⚠️⚠️⚠️ You probably don’t need to call this method ⚠️⚠️⚠️
lettre usually picks the correct port
when building
SmtpTransport
using SmtpTransport::relay
or
SmtpTransport::starttls_relay
.
§Errors
Using the incorrect port
and Self::tls
combination may
lead to hard to debug IO errors coming from the TLS library.
Sourcepub fn tls(self, tls: Tls) -> Self
pub fn tls(self, tls: Tls) -> Self
Set the TLS settings to use
§⚠️⚠️⚠️ You probably don’t need to call this method ⚠️⚠️⚠️
By default lettre chooses the correct tls
configuration when
building SmtpTransport
using SmtpTransport::relay
or
SmtpTransport::starttls_relay
.
§Errors
Using the wrong Tls
and Self::port
combination may
lead to hard to debug IO errors coming from the TLS library.
Sourcepub fn pool_config(self, pool_config: PoolConfig) -> Self
pub fn pool_config(self, pool_config: PoolConfig) -> Self
Use a custom configuration for the connection pool
Defaults can be found at PoolConfig
Sourcepub fn build(self) -> SmtpTransport
pub fn build(self) -> SmtpTransport
Build the transport
If the pool
feature is enabled, an Arc
wrapped pool is created.
Defaults can be found at PoolConfig
Trait Implementations§
Source§impl Clone for SmtpTransportBuilder
impl Clone for SmtpTransportBuilder
Source§fn clone(&self) -> SmtpTransportBuilder
fn clone(&self) -> SmtpTransportBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more