我嘗試在 mailhog 中使用 api
Get /api/v1/messages
[
{
"ID": "[email protected]",
"From": {
"Relays": null,
"Mailbox": "developer-send-mail",
"Domain": "gmail.com",
"Params": ""
},
"To": [
{
"Relays": null,
"Mailbox": "developer-recv-mail",
"Domain": "gmail.com",
"Params": ""
}
],
"Content": {
"Headers": {
"Message-ID": [
"[email protected]"
],
"Received": [
"from smtp.gmail.com by mailhog.example (MailHog)\r\n id [email protected]; Mon, 22 Nov 2021 18:30:16 0000"
],
"Return-Path": [
"<[email protected]>"
]
},
"Body": "test my message\r\nnew1\r\nmulti line",
"Size": 33,
"MIME": null
},
"Created": "2021-11-22T18:30:16.822037969Z",
"MIME": null,
"Raw": {
"From": "[email protected]",
"To": [
"[email protected]"
],
"Data": "test my nessaje\r\nnew1\r\nmulti line",
"Helo": "smtp.gmail.com"
}
},
]
然后我
發布/api/v1/messages/[email protected]/release
Body
{
"Host": "smtp.gmail.com",
"Port": "587",
"Username": "[email protected]",
"Password": "MyMailPassword",
"Mechanism": "PLAIN",
"Email": "[email protected]"
}
回應代碼:200
但在 gmail [email protected]中無法收到此電子郵件
uj5u.com熱心網友回復:
在發布端點的 post 值中,指定Email值[email protected]. 既然這個值是接收者,我相信這應該是[email protected]從聲音上來的吧?
https://github.com/mailhog/MailHog/blob/master/docs/APIv1.md#post-apiv1messages-message_id-release
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/364759.html
上一篇:發送電子郵件時字體大小已更改
