pub struct SmtpConfig {
pub host: String,
pub port: u16,
pub username: String,
pub password: String,
pub encryption: Encryption,
pub timeout: Duration,
pub hello: String,
}Expand description
Everything needed to reach one SMTP server.
Debug is written by hand: a config struct ends up in log lines and in
error contexts, and a password that reaches either is a password that has
to be rotated.
Fields§
§host: String§port: u16§username: String§password: String§encryption: Encryption§timeout: DurationHow long any single read or write may take.
hello: StringThe name announced in EHLO.
Implementations§
Source§impl SmtpConfig
impl SmtpConfig
pub fn new(host: impl Into<String>, port: u16) -> SmtpConfig
pub fn credentials( self, username: impl Into<String>, password: impl Into<String>, ) -> Self
pub fn encryption(self, encryption: Encryption) -> Self
pub fn address(&self) -> String
Sourcepub fn implicit_tls(&self) -> bool
pub fn implicit_tls(&self) -> bool
Whether TLS is negotiated before the greeting, as port 465 requires.
pub fn wants_starttls(&self) -> bool
pub fn requires_starttls(&self) -> bool
Trait Implementations§
Source§impl Clone for SmtpConfig
impl Clone for SmtpConfig
Source§impl Debug for SmtpConfig
impl Debug for SmtpConfig
Auto Trait Implementations§
impl Freeze for SmtpConfig
impl RefUnwindSafe for SmtpConfig
impl Send for SmtpConfig
impl Sync for SmtpConfig
impl Unpin for SmtpConfig
impl UnsafeUnpin for SmtpConfig
impl UnwindSafe for SmtpConfig
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