Skip to content

Unable to make use of Postbin #337

@eegrok

Description

@eegrok

I'm trying to debug an issue with the client, and I've got some code I'm using -- pulled straight from the github page, substituting in my api key and domain / email addresses. When I run it having it send the email using the regular mailgun client, it works fine. If I use the extra parameters, specifying bin.mailgun.net and the code -- it gives me the following error:

405 Method Not Allowed

any tips on how to make this work?

(I am of course substituing my actual api key and domain in the code -- I've tried both my live domain and sandbox, but they both give the 405)

$api_key = 'my-api-key'
$domain = 'my-domain'

def test_postbin(mg_client, subject)
  mg_client ||= Mailgun::Client.new($api_key, "bin.mailgun.net", "7d9a62e", ssl = false)
  message_params = {  from: "me@#{$domain}",
    to: 'testuser@myotherdomain.com',
    subject: subject,
    text: 'It is really easy to send a message -- hopefully this works!'
  }
  mg_client.send_message($domain, message_params)
end

mg_client = Mailgun::Client.new($api_key)
test_postbin(mg_client, "testing with mailgun")
test_postbin(nil, "testing with postbin")

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions