You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用Outlook API回复邮件遇202无响应体,PR_SEARCH_KEY使用咨询

Troubleshooting Outlook API Sendmail 202 Accepted Empty Response Issue

Hey there, let's work through this Outlook API sendmail problem you're hitting. That 202 Accepted status with an empty response can feel vague, but we can break down actionable fixes to get your reply functionality working reliably.

First, understand what 202 Accepted means

The 202 status tells you the server has accepted your request but hasn't finished processing it yet. This is normal for asynchronous operations like sending mail, but if you're not seeing the reply delivered or need to track its status, we need to add more context to your request.

Fix 1: Correctly embed PR_SEARCH_KEY in your request

PR_SEARCH_KEY (mapped to property ID String 0x0031) lets you uniquely identify the sent message later to verify its status. Here's how to properly include it in your POST payload:

{
  "Message": {
    "Subject": "Re: Follow-up on your inquiry",
    "Body": {
      "ContentType": "HTML",
      "Content": "<p>Thanks for reaching out—here's my reply!</p>"
    },
    "ToRecipients": [
      {
        "EmailAddress": {
          "Address": "recipient@example.com"
        }
      }
    ],
    "InReplyTo": "<original-message-id@domain.com>", // Critical for linking as a reply
    "ExtendedProperties": [
      {
        "PropertyId": "String 0x0031",
        "Value": "unique-uuid-or-identifier-here" // Use a unique value like a UUID per message
      }
    ]
  },
  "SaveToSentItems": "true" // Ensure the reply is saved to your Sent Items
}
  • The InReplyTo field is essential for Outlook to recognize the message as a reply to the original email.
  • Use a unique value (like a UUID) for PR_SEARCH_KEY so you can later search for the message to confirm delivery.

Fix 2: Track the message status post-request

Since 202 is asynchronous, use the PR_SEARCH_KEY you set to query the message's status with a GET request:

GET https://outlook.office.com/api/v2.0/Users/your-email/Messages?$filter=SingleValueExtendedProperties/any(ep: ep/PropertyId eq 'String 0x0031' and ep/Value eq 'your-unique-search-key-here')

This will return the full message object, including its delivery status and any error details if something went wrong.

Fix 3: Verify permissions and API configuration

  • Ensure your app has the correct Mail.Send permission (either Delegated for user-specific access or Application for service-level access, depending on your use case).
  • Double-check that you're using the correct user identifier in the API URL—use the user's email address or their Azure AD object ID to avoid targeting the wrong mailbox.

Fix 4: Check for delivery failures

If the reply isn't reaching the recipient, have an Office 365 admin check the Exchange Admin Center's Mail Trace tool. This will show if the message was blocked, bounced, or delayed, and give specific error codes to debug further.

Give these steps a shot, and if you still run into issues, feel free to share your exact request payload (redacted for sensitive info) or any error details from the mail trace—we can narrow it down further.

内容的提问来源于stack exchange,提问作者Jais Anasrulloh Ja'fari

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 09:09:46