feat(graph): support sending, replying, and forwarding emails

This commit is contained in:
rustmailer
2026-02-04 00:37:07 +08:00
parent df54ff66ae
commit a6854396be
11 changed files with 328 additions and 112 deletions
+15
View File
@@ -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
View File
@@ -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| {