Struct mail_send::SmtpClientBuilder
source · 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: StringImplementations§
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)