MailgunAPIError: <Response [400]>
See original GitHub issueHi,
I just following your readme, but I keep getting this error :
This is my setting (I’m not sure, whether I should using secret key or public key, but both is error when I’m trying to send email) :
EMAIL_BACKEND = 'django_mailgun.MailgunBackend'
MAILGUN_ACCESS_KEY = 'key-06b1d48a5805393c825ceefa054bXXXX'
MAILGUN_SERVER_NAME = 'sandboxfa1f6fe021044f319c639f9da08eXXXX.mailgun.org'
My views.py :
def order_form(request):
if request.method == "POST":
form = OrderForm(request.POST, request.FILES)
if form.is_valid():
order = form.save(commit=False)
order.tanggal_order = datetime.datetime.now()
order.save()
subject = "NEW ZEGUYO ORDER"
to = [order.email, 'alzea.arafat@gmail.com', 'cahyosumirat93@gmail.com']
from_email = 'no-reply@zeguyo.com'
ctx = {
'nama': order.nama,
'id_order': order.id,
}
message = get_template('email/order_email.html').render(Context(ctx))
msg = EmailMessage(subject, message, to=to, from_email=from_email)
msg.content_subtype = 'html'
msg.send()
return render(request, 'order_app/order_success.html')
else:
form = OrderForm()
return render(request, 'order_app/order_form.html', {'form': form})
I’m using django 1.9.2, Python 2.7
Did I miss something here?
Thank you in advance for any help you can provide 😃
Regards,
Issue Analytics
- State:
- Created 8 years ago
- Reactions:1
- Comments:9
Top Results From Across the Web
MailgunAPIError<Response [400]> with ... - Stack Overflow
I'm trying to send registration emails by django-registration-redux, but got this response code: MailgunAPIError Response [400].
Read more >Introduction — Mailgun API documentation
Mailgun returns standard HTTP response codes. Code, Description. 200, Everything worked as expected. 400, Bad Request - Often missing ...
Read more >MailgunAPIError<Response [400]> with django-registration ...
I solved the problem by myself. I changed the EMAIL_BACKEND from 'django_mailgun.MailgunBackend' to 'django.core.mail.backends.smtp.
Read more >Bountysource
MailgunAPIError : <Response [400] · Javascript Required. Kindly enable Javascript. · Updates · Content Removed.
Read more >django_mailgun.MailgunAPIError: Response [401] - CSDN博客
完整报错如下:Internal Server Error: /accounts/login/Traceback (most ... 使用HTTP Status区分不同消息返回最基础的三个状态200 OK, 400 Client ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Got the same error
@alzearafat try below settings in mailgun
Security Settings For Outgoing Mail Certificate Verification Not Required
it works for me
You can see error details in your Mailgun Logs. I got 400 response because I haven’t activated account.