Giter Site home page Giter Site logo

Comments (7)

BradWhittington avatar BradWhittington commented on June 26, 2024

Do you have a copy of the error the API throws? I am using the MIME api, so I can send a raw mime message...which implies HTML parts should be acceptable, as with any other encoding...

from django-mailgun.

BradWhittington avatar BradWhittington commented on June 26, 2024

I have just successfully sent a multi-part (HTML and plaintext) email using this transport. I don't think the API end point is the issue here...

from django-mailgun.

exupero avatar exupero commented on June 26, 2024

I must have been doing it wrong. I tried sending an emdash HTML entity and got "—". Do I need to wrap HTML content in an HTML tag?

from django-mailgun.

BradWhittington avatar BradWhittington commented on June 26, 2024

Can you give a code sample?

from django-mailgun.

exupero avatar exupero commented on June 26, 2024
from django.core.mail import send_mail

send_mail('A Comment', '—from me', '[email protected]', ['[email protected]'], fail_silently=True)

from django-mailgun.

BradWhittington avatar BradWhittington commented on June 26, 2024

Running that code, it sends an email fine. IT is not encoded as HTML because you haven't created an HTML email. It won't magically be HTML, and the default of that convenience method is to send plaintext.

You should look at the django docs for sending email - https://docs.djangoproject.com/en/dev/topics/email/ specifically https://docs.djangoproject.com/en/dev/topics/email/#sending-alternative-content-types (basically you need to create a relevant EmailMessage).

Alternatively, simplifying sending html/multi-part emails is the focus of one of my other projects - https://github.com/bradwhittington/django-templated-email </shameless plug>

from django-mailgun.

exupero avatar exupero commented on June 26, 2024

Thanks for the pointer to the Django docs! That's what I needed! I really appreciate your help.

from django-mailgun.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.