Struct async_mailer::OutlookMailer
source · pub struct OutlookMailer { /* private fields */ }Expand description
An Outlook mailer client, implementing the async_mailer::Mailer trait to be used as runtime-pluggable trait object.
Sends mail authenticated by OAuth2 client credentials grant via the Microsoft Graph API.
Implementations§
source§impl OutlookMailer
impl OutlookMailer
sourcepub async fn new(
tenant: String,
app_guid: String,
secret: Secret<String>
) -> impl Future<Output = Result<OutlookMailer, Box<dyn Error + Sync + Send + 'static, Global>>>
pub async fn new( tenant: String, app_guid: String, secret: Secret<String> ) -> impl Future<Output = Result<OutlookMailer, Box<dyn Error + Sync + Send + 'static, Global>>>
Create a new Outlook mailer client.
Returns a OutlookMailerError::RetrieveAccessToken
when the attempt to retrieve an access token from the Microsoft Identity Service fails.
Trait Implementations§
source§impl Clone for OutlookMailer
impl Clone for OutlookMailer
source§fn clone(&self) -> OutlookMailer
fn clone(&self) -> OutlookMailer
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 OutlookMailer
impl Debug for OutlookMailer
source§impl Mailer for OutlookMailer
impl Mailer for OutlookMailer
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,
OutlookMailer: '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, OutlookMailer: 'async_trait,
Send the prepared MIME message via the Microsoft Graph API.
Auto Trait Implementations§
impl !RefUnwindSafe for OutlookMailer
impl Send for OutlookMailer
impl Sync for OutlookMailer
impl Unpin for OutlookMailer
impl !UnwindSafe for OutlookMailer
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