Struct async_mailer::SmtpMailer
source · pub struct SmtpMailer { /* private fields */ }Expand description
An SMTP mailer client, implementing the [async_mailer::Mailer] and [async_mailer::DynMailer] traits
to be used as generic mailer or runtime-pluggable trait object.
An abstraction over mail_send, sending mail via an SMTP connection.
Self-signed certificates can optionally be accepted, to use the SMTP mailer in development while using the Outlook mailer in production.
Implementations§
source§impl SmtpMailer
impl SmtpMailer
sourcepub fn new(
host: String,
port: u16,
invalid_certs: SmtpInvalidCertsPolicy,
user: String,
password: Secret<String>
) -> SmtpMailer
pub fn new( host: String, port: u16, invalid_certs: SmtpInvalidCertsPolicy, user: String, password: Secret<String> ) -> SmtpMailer
Create a new SMTP mailer client.
Trait Implementations§
source§impl Clone for SmtpMailer
impl Clone for SmtpMailer
source§fn clone(&self) -> SmtpMailer
fn clone(&self) -> SmtpMailer
Returns a copy of the value. Read more
1.0.0 · 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 SmtpMailer
impl Debug for SmtpMailer
source§impl DynMailer for SmtpMailer
impl DynMailer for SmtpMailer
source§fn send_mail<'life0, 'life1, 'async_trait>(
&'life0 self,
message: Message<'life1>
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Sync + Send + 'static, Global>>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
'life1: 'async_trait,
SmtpMailer: 'async_trait,
fn send_mail<'life0, 'life1, 'async_trait>( &'life0 self, message: Message<'life1> ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Sync + Send + 'static, Global>>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, 'life1: 'async_trait, SmtpMailer: 'async_trait,
Send the prepared MIME message via an SMTP connection.
source§impl Mailer for SmtpMailer
impl Mailer for SmtpMailer
type Error = SmtpMailerError
fn send_mail<'life0, 'life1, 'async_trait>( &'life0 self, message: Message<'life1> ) -> Pin<Box<dyn Future<Output = Result<(), <SmtpMailer as Mailer>::Error>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, 'life1: 'async_trait, SmtpMailer: 'async_trait,
Auto Trait Implementations§
impl !RefUnwindSafe for SmtpMailer
impl Send for SmtpMailer
impl Sync for SmtpMailer
impl Unpin for SmtpMailer
impl !UnwindSafe for SmtpMailer
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