Postman 主要用于 API 接口測試,而不是直接用于郵件測試。但是,如果你想通過 Postman 發送郵件并驗證其發送結果,你可以按照以下步驟操作:
{
"to": "recipient@example.com",
"from": "sender@example.com",
"subject": "Test Email",
"text": "This is a test email sent using Postman."
}
pm.test("Email sent successfully", function () {
pm.response.to.have.status(200);
var jsonData = pm.response.json();
pm.expect(jsonData.message).to.eql("Email sent successfully");
});
請注意,Postman 并不是專門為郵件測試設計的工具,上述方法是一種變通的方式。如果你需要進行更復雜的郵件測試,可能需要考慮使用專門的郵件測試工具或服務。