rest - Send email with Mailgun with Javascript - Stack Overflow

I'm working with JS and I have the following code:var XHRResponse = XHR.send("POST", &qu

I'm working with JS and I have the following code:

  var XHRResponse = XHR.send("POST", ".mailgun/messages",{
    "parameters": {
      "from": "Mailgun Sandbox <[email protected]>",
      "to": "Jordi <[email protected]>",
      "subject": "Hello Jordi",
      "text": "Congratulations Jordi, you just sent an email with Mailgun!  You are truly awesome!  You can see a record of this email in your logs: .  You can send up to 300 emails/day from this sandbox server.  Next, you should add your domain so you can send 10,000 emails/month for free."
    }
  }); 

I need to authenticate with the API key but I don't know where and how.

I'm working with JS and I have the following code:

  var XHRResponse = XHR.send("POST", "https://api.mailgun/v2/sandbox224f28ae45a8499d84184fd4c48e62ee.mailgun/messages",{
    "parameters": {
      "from": "Mailgun Sandbox <[email protected]>",
      "to": "Jordi <[email protected]>",
      "subject": "Hello Jordi",
      "text": "Congratulations Jordi, you just sent an email with Mailgun!  You are truly awesome!  You can see a record of this email in your logs: https://mailgun./cp/log.  You can send up to 300 emails/day from this sandbox server.  Next, you should add your domain so you can send 10,000 emails/month for free."
    }
  }); 

I need to authenticate with the API key but I don't know where and how.

Share Improve this question edited Jul 26, 2024 at 22:51 LW001 2,9337 gold badges32 silver badges42 bronze badges asked Jun 11, 2014 at 10:02 user3729460user3729460 591 silver badge2 bronze badges 2
  • 1 See this for authentication: stackoverflow./questions/5507234/… – xyres Commented Oct 16, 2016 at 16:52
  • You can't send email from the browser. If you do this, people will steal your API key and use it to send huge volumes of spam (or worse) on your behalf. – user229044 Commented Jul 26, 2024 at 23:20
Add a ment  | 

1 Answer 1

Reset to default 10

Mailgun API documentation has the entirety of this information. Look at the Authentication section specifically, https://documentation.mailgun./docs/mailgun/api-reference/authentication/. However with that being said, I wouldn't run this in the client if they, and if I understood correctly, require the key to be written in plain text.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1743735931a4498259.html

相关推荐

  • rest - Send email with Mailgun with Javascript - Stack Overflow

    I'm working with JS and I have the following code:var XHRResponse = XHR.send("POST", &qu

    6天前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信