我正在努力尝试使用cURL通过Mandrill API发送电子邮件。由于某种原因,该命令不被视为有效的JSON操作。我已经尝试按照网站上的说明进行以下操作:
Backspace is replaced with \b
Form feed is replaced with \f
Newline is replaced with \n
Carriage return is replaced with \r
Tab is replaced with \t
Double quote is replaced with \"
Backslash is replaced with \\
将双引号替换为单引号。什么都没有。
这是HTML模板:https://pastebin.com/BN7FMStg
这是我的代码:
curl -H -A "Mandrill-Curl/1.0" -d '{
"key": "XXXXXX",
"message": {
"html": "<b>Hi there!</b>",
"subject": "Just testing",
"from_email": "noreply@mydomain.com",
"from_name": "MyName",
"to": [
{
"email": "rex@mydomain.com",
"type": "to"
}
],
"return_path_domain": "mydomain.com",
"important": false,
"track_opens": false,
"track_clicks": false,
"async": true
}
}'
'https://mandrillapp.com/api/1.0/messages/send.json'
我没有任何想法了。如果任何人都有完整的工作示例和说明,以便我自己理解,那就太好了。