發送我的第一封電子郵件可以得到一些幫助嗎?以下是我想發送的內容。我不確定我是否應該使用創建的子域mg.example.com或example.com。該域名在郵件控制面板中處於「活動」和「已驗證」狀態。在Mailgun退回發送測試郵件404找不到
此外,在mailgun.org儀表板中的api私鑰之前還有一個「密鑰」前綴。這是否包含在cURL參數中?我在Windows 10
這是mailgun樣品捲曲CMD從their quickstart: curl -s --user 'api:YOUR_API_KEY' \ https://api.mailgun.net/v3/YOUR_DOMAIN_NAME/messages \ -F from='Excited User <[email protected]_DOMAIN_NAME>' \ -F [email protected]_DOMAIN_NAME \ -F [email protected] \ -F subject='Hello' \ -F text='Testing some Mailgun awesomness!'
這是我的版本是:
````
curl -s --user 'api:key-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
https://api.mailgun.net/v3/mg.example.com/messages \
-F from='Excited User <[email protected]>' \
-F [email protected] \
-F [email protected] \
-F subject='Hello' \
-F text='Testing some Mailgun awesomness!'
````
我也試過這個版本既毫克。 example.com和example.com作爲url。這是響應:
````
curl -s --user 'api:key-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
https://api.mailgun.net/v3/example.com/messages from='Excited User <[email protected]>'
[email protected] [email protected] subject='Hello' text='Testing some Mailgun awesomness!'
````
這是我收到的錯誤:
````
HTTP/1.1 405 METHOD NOT ALLOWED
server: nginx
date: Sun, 25 Sep 2016 11:40:43 GMT
content-type: text/html; charset=utf-8
content-length: 182
connection: close
allow: POST, OPTIONS
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>405 Method Not Allowed</title>
<h1>Method Not Allowed</h1>
<p>The method GET is not allowed for the requested URL.</p>
````
有史以來第一次這樣做。謝謝你的幫助。
錯誤輸入SO,已更正。但答案是否定的。我只是嘗試了url和mg.url。 'curl:(6)無法解析主機:'。 mailgun是什麼意思的活躍和驗證。沒有託管網站,但DNS設置...感謝指導。另外,''''C:\ Users \ aarmand> curl https://api.mailgun.net/v3/ <!DOCTYPE HTML PUBLIC「 - // W3C // DTD HTML 3.2 Final // EN」>
Not Found
在服務器上找不到請求的URL。
如果您手動輸入網址,請檢查拼寫並重試。
'''' – idkjs我在查看它之後編輯url語法。現在錯誤是「方法不允許」。 – idkjs
'-X POST'如果需要'POST',這裏是'GET'版本(默認) –