pub struct MailConfig {
pub driver: String,
pub from_address: String,
pub from_name: String,
pub reply_to: Option<String>,
pub smtp_host: Option<String>,
pub smtp_port: u16,
pub smtp_username: Option<String>,
pub smtp_password: Option<String>,
pub smtp_encryption: String,
pub postmark_api_key: Option<String>,
pub resend_api_key: Option<String>,
}Fields§
§driver: StringDriver to use: “log” (default, prints to stdout) or “smtp”.
from_address: StringEnvelope from address.
from_name: StringDisplay name for the from address.
reply_to: Option<String>Default reply-to address.
smtp_host: Option<String>SMTP host (required when driver = “smtp”).
smtp_port: u16SMTP port. Default: 587.
smtp_username: Option<String>SMTP username for authentication.
smtp_password: Option<String>SMTP password for authentication.
smtp_encryption: StringEncryption mode: “starttls” (default), “tls”, or “none”.
postmark_api_key: Option<String>API key for the Postmark driver.
resend_api_key: Option<String>API key for the Resend driver.
Implementations§
Source§impl MailConfig
impl MailConfig
Sourcepub fn from(self, address: impl Into<String>, name: impl Into<String>) -> Self
pub fn from(self, address: impl Into<String>, name: impl Into<String>) -> Self
Set the default from address and display name (builder style).
Sourcepub fn postmark_key(self, key: impl Into<String>) -> Self
pub fn postmark_key(self, key: impl Into<String>) -> Self
Set the Postmark API key (builder style).
Sourcepub fn resend_key(self, key: impl Into<String>) -> Self
pub fn resend_key(self, key: impl Into<String>) -> Self
Set the Resend API key (builder style).
Trait Implementations§
Source§impl Clone for MailConfig
impl Clone for MailConfig
Source§fn clone(&self) -> MailConfig
fn clone(&self) -> MailConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more