Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to make use of Postbin #337

Open
eegrok opened this issue Jan 28, 2025 · 0 comments
Open

Unable to make use of Postbin #337

eegrok opened this issue Jan 28, 2025 · 0 comments
Assignees

Comments

@eegrok
Copy link

eegrok commented Jan 28, 2025

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: '[email protected]',
    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")

@alex-leb alex-leb self-assigned this Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants