pub struct SmtpClientBuilder<T: AsRef<str> + PartialEq + Eq + Hash> {
pub timeout: Duration,
pub tls_connector: TlsConnector,
pub tls_hostname: T,
pub tls_implicit: bool,
pub credentials: Option<Credentials<T>>,
pub addr: String,
pub is_lmtp: bool,
pub say_ehlo: bool,
pub local_host: String,
}
Expand description
SMTP client builder
Fields§
§timeout: Duration
§tls_connector: TlsConnector
§tls_hostname: T
§tls_implicit: bool
§credentials: Option<Credentials<T>>
§addr: String
§is_lmtp: bool
§say_ehlo: bool
§local_host: String
Implementations§
Source§impl<T: AsRef<str> + PartialEq + Eq + Hash> SmtpClientBuilder<T>
impl<T: AsRef<str> + PartialEq + Eq + Hash> SmtpClientBuilder<T>
pub fn new(hostname: T, port: u16) -> Self
Sourcepub fn allow_invalid_certs(self) -> Self
pub fn allow_invalid_certs(self) -> Self
Allow invalid TLS certificates
Sourcepub fn implicit_tls(self, tls_implicit: bool) -> Self
pub fn implicit_tls(self, tls_implicit: bool) -> Self
Start connection in TLS or upgrade with STARTTLS
pub fn say_ehlo(self, say_ehlo: bool) -> Self
Sourcepub fn credentials(self, credentials: impl Into<Credentials<T>>) -> Self
pub fn credentials(self, credentials: impl Into<Credentials<T>>) -> Self
Sets the authentication credentials
Sourcepub async fn connect_plain(&self) -> Result<SmtpClient<TcpStream>>
pub async fn connect_plain(&self) -> Result<SmtpClient<TcpStream>>
Connect over clear text (should not be used)
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for SmtpClientBuilder<T>where
T: Freeze,
impl<T> !RefUnwindSafe for SmtpClientBuilder<T>
impl<T> Send for SmtpClientBuilder<T>where
T: Send,
impl<T> Sync for SmtpClientBuilder<T>where
T: Sync,
impl<T> Unpin for SmtpClientBuilder<T>where
T: Unpin,
impl<T> !UnwindSafe for SmtpClientBuilder<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more