pub struct MailConfig {
pub transport: TransportKind,
pub host: String,
pub port: u16,
pub username: String,
pub password: String,
pub encryption: Encryption,
pub path: PathBuf,
pub from_address: String,
pub from_name: String,
pub timeout: Duration,
}Expand description
Everything config/mail.json holds.
Debug is hand-written so a password cannot reach a log line by being
printed alongside the rest of the settings.
Fields§
§transport: TransportKind§host: String§port: u16§username: String§password: String§encryption: Encryption§path: PathBufWhere the file transport writes its .eml files.
from_address: StringThe default sender, used by any message that does not set its own.
from_name: String§timeout: DurationImplementations§
Source§impl MailConfig
impl MailConfig
pub fn from_app_config(config: &Config) -> Result<MailConfig>
Sourcepub fn from(&self) -> Result<Option<Address>>
pub fn from(&self) -> Result<Option<Address>>
The configured sender, if there is one and it is valid.
Sourcepub fn smtp(&self) -> SmtpConfig
pub fn smtp(&self) -> SmtpConfig
The settings the SMTP transport needs.
Trait Implementations§
Source§impl Clone for MailConfig
impl Clone for MailConfig
Source§impl Debug for MailConfig
impl Debug for MailConfig
Auto Trait Implementations§
impl Freeze for MailConfig
impl RefUnwindSafe for MailConfig
impl Send for MailConfig
impl Sync for MailConfig
impl Unpin for MailConfig
impl UnsafeUnpin for MailConfig
impl UnwindSafe for MailConfig
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