mirror of
https://github.com/rustmailer/rustmailer.git
synced 2026-09-09 08:02:03 +00:00
feat(graph): support sending, replying, and forwarding emails
This commit is contained in:
+15
@@ -390,6 +390,21 @@ impl OutlookClient {
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
pub async fn send_email(
|
||||
account_id: u64,
|
||||
use_proxy: Option<u64>,
|
||||
message_base64: String,
|
||||
) -> RustMailerResult<()> {
|
||||
let url = "https://graph.microsoft.com/v1.0/me/sendMail";
|
||||
let client = HttpClient::new(use_proxy).await?;
|
||||
let access_token = Self::get_access_token(account_id).await?;
|
||||
client
|
||||
.post_text::<()>(url, &access_token, message_base64, false)
|
||||
.await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn batch_get_categories(
|
||||
account_id: u64,
|
||||
use_proxy: Option<u64>,
|
||||
|
||||
+1
-1
@@ -351,7 +351,7 @@ impl OutlookEnvelope {
|
||||
impl TryFrom<Message> for OutlookEnvelope {
|
||||
type Error = RustMailerError;
|
||||
|
||||
fn try_from(msg: Message) -> Result<Self, Self::Error> {
|
||||
fn try_from(msg: Message) -> Result<Self, Self::Error> {
|
||||
fn parse_datetime(dt: &Option<String>) -> RustMailerResult<Option<i64>> {
|
||||
dt.as_ref()
|
||||
.map(|s| {
|
||||
|
||||
Reference in New Issue
Block a user