Giter Site home page Giter Site logo

Multiple mail connection about django-mailer HOT 4 CLOSED

pinax avatar pinax commented on May 26, 2024
Multiple mail connection

from django-mailer.

Comments (4)

spookylukey avatar spookylukey commented on May 26, 2024

I'm afraid I can't understand your question. EMAIL_CONNECTIONS is not a standard Django setting. Are you using an extension that uses this? If so, please let me know what this extension is, or show more of your code that is actually using this.

from django-mailer.

salvorapi avatar salvorapi commented on May 26, 2024

You're right. EMAIL_CONNECTIONS is a custom setting of my app that I use to define multiple mail config and assign to connection param on send_mail function (https://docs.djangoproject.com/en/1.10/topics/email/#send-mail).

I've used this solution because I need to send mail from different account.
Now, my problem is that in case SMTP fail the mail is lost and your solution is perfect because store mail in DB and delivery is managed by cron job.

But I need to use different SMTP account.
Do you think it's possible ?

Thank you.

Salvo.

from django-mailer.

spookylukey avatar spookylukey commented on May 26, 2024

It depends on how you decide which connection to use.

First, work out whether it is possible to write your custom connection/send_mail logic as a custom email backend - https://docs.djangoproject.com/en/1.10/topics/email/#defining-a-custom-email-backend - this will be possible, for example, if you can tell just by examining the message (e.g. the from/to address) which SMTP details are needed. If the decision of which backend to use is made using contextual information from the calling code that isn't stored in the message itself, you will have difficulties.

If if it possible, then first write that backend and refactor your code to use it. Then simply install django-mailer and use a custom backend as described here https://github.com/pinax/django-mailer/blob/master/docs/usage.rst#usage :

EMAIL_BACKEND = "mailer.backend.DbBackend"
MAILER_EMAIL_BACKEND = "your.custom.EmailBackend"

from django-mailer.

salvorapi avatar salvorapi commented on May 26, 2024

Yes, I think to use from_address to route mail over multiple account.
I didn't see the MAILER_EMAIL_BACKEND setting. Can be perfect for what I need to do.

Thank you.

Salvo.

from django-mailer.

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.