Struct async_smtp::SmtpClient
source · pub struct SmtpClient { /* private fields */ }
Expand description
Contains client configuration
Implementations§
source§impl SmtpClient
impl SmtpClient
Builder for the SMTP SmtpTransport
sourcepub fn with_security(
server_addr: ServerAddress,
security: ClientSecurity
) -> SmtpClient
pub fn with_security(
server_addr: ServerAddress,
security: ClientSecurity
) -> SmtpClient
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
instead, if possible.
sourcepub fn new(domain: String) -> SmtpClient
pub fn new(domain: String) -> SmtpClient
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_host_port(host: String, port: u16) -> SmtpClient
sourcepub fn new_unencrypted_localhost() -> SmtpClient
pub fn new_unencrypted_localhost() -> SmtpClient
Creates a new local SMTP client to port 25
sourcepub fn smtp_utf8(self, enabled: bool) -> SmtpClient
pub fn smtp_utf8(self, enabled: bool) -> SmtpClient
Enable SMTPUTF8 if the server supports it
sourcepub fn hello_name(self, name: ClientId) -> SmtpClient
pub fn hello_name(self, name: ClientId) -> SmtpClient
Set the name used during EHLO
sourcepub fn connection_reuse(
self,
parameters: ConnectionReuseParameters
) -> SmtpClient
pub fn connection_reuse(
self,
parameters: ConnectionReuseParameters
) -> SmtpClient
Enable connection reuse
sourcepub fn connection_type(self, connection_type: ConnectionType) -> Self
pub fn connection_type(self, connection_type: ConnectionType) -> Self
Set the ConnectionType
sourcepub fn credentials<S: Into<Credentials>>(self, credentials: S) -> SmtpClient
pub fn credentials<S: Into<Credentials>>(self, credentials: S) -> SmtpClient
Set the client credentials
sourcepub fn authentication_mechanism(self, mechanism: Vec<Mechanism>) -> SmtpClient
pub fn authentication_mechanism(self, mechanism: Vec<Mechanism>) -> SmtpClient
Set the authentication mechanism to use
sourcepub fn force_set_auth(self, force: bool) -> SmtpClient
pub fn force_set_auth(self, force: bool) -> SmtpClient
Set if the set authentication mechanism should be force
sourcepub fn timeout(self, timeout: Option<Duration>) -> SmtpClient
pub fn timeout(self, timeout: Option<Duration>) -> SmtpClient
Set the timeout duration
sourcepub fn into_transport(self) -> SmtpTransport
pub fn into_transport(self) -> SmtpTransport
Build the SMTP client
It does not connect to the server, but only creates the SmtpTransport