Overslaan naar inhoud
Odoo Menu
  • Aanmelden
  • Probeer het gratis
  • Apps
    Financiën
    • Boekhouding
    • Facturatie
    • Onkosten
    • Spreadsheet (BI)
    • Documenten
    • Ondertekenen
    Verkoop
    • CRM
    • Verkoop
    • Kassasysteem winkel
    • Kassasysteem Restaurant
    • Abonnementen
    • Verhuur
    Websites
    • Websitebouwer
    • E-commerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Bevoorradingsketen
    • Voorraad
    • Productie
    • PLM
    • Inkoop
    • Onderhoud
    • Kwaliteit
    Personeelsbeheer
    • Werknemers
    • Werving & Selectie
    • Verlof
    • Evaluaties
    • Aanbevelingen
    • Wagenpark
    Marketing
    • Social media Marketing
    • E-mailmarketing
    • SMS Marketing
    • Evenementen
    • Marketingautomatisering
    • Enquêtes
    Diensten
    • Project
    • Urenstaten
    • Buitendienst
    • Helpdesk
    • Planning
    • Afspraken
    Productiviteit
    • Chat
    • Goedkeuringen
    • IoT
    • VoIP
    • Kennis
    • WhatsApp
    Apps van derden Odoo Studio Odoo Cloud Platform
  • Bedrijfstakken
    Detailhandel
    • Boekhandel
    • kledingwinkel
    • Meubelzaak
    • Supermarkt
    • Bouwmarkt
    • Speelgoedwinkel
    Food & Hospitality
    • Bar en Pub
    • Restaurant
    • Fastfood
    • Gastenverblijf
    • Drankenhandelaar
    • Hotel
    Vastgoed
    • Makelaarskantoor
    • Architectenbureau
    • Bouw
    • Vastgoedbeheer
    • Tuinieren
    • Vereniging van eigenaren
    Consulting
    • Accountantskantoor
    • Odoo Partner
    • Marketingbureau
    • Advocatenkantoor
    • Talentenwerving
    • Audit & Certificering
    Productie
    • Textiel
    • Metaal
    • Meubels
    • Eten
    • Brewery
    • Relatiegeschenken
    Gezondheid & Fitness
    • Sportclub
    • Opticien
    • Fitnesscentrum
    • Wellness-medewerkers
    • Apotheek
    • Kapper
    Trades
    • Klusjesman
    • IT-hardware & support
    • Zonne-energiesystemen
    • Schoenmaker
    • Schoonmaakdiensten
    • HVAC-diensten
    Andere
    • Non-profit organisatie
    • Milieuagentschap
    • Verhuur van Billboards
    • Fotograaf
    • Fietsleasing
    • Softwareverkoper
    Browse all Industries
  • Community
    Leren
    • Tutorials
    • Documentatie
    • Certificeringen
    • Training
    • Blog
    • Podcast
    Versterk het onderwijs
    • Onderwijs- programma
    • Scale Up! Business Game
    • Bezoek Odoo
    Download de Software
    • Downloaden
    • Vergelijk edities
    • Releases
    Werk samen
    • Github
    • Forum
    • Evenementen
    • Vertalingen
    • Word een Partner
    • Services for Partners
    • Registreer je accountantskantoor
    Diensten
    • Vind een partner
    • Vind een boekhouder
    • Een adviseur ontmoeten
    • Implementatiediensten
    • Klantreferenties
    • Ondersteuning
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Vraag een demo aan
  • Prijzen
  • Help

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Boekhouding
  • Voorraad
  • PoS
  • Project
  • MRP
All apps
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Help

Correct way to use multiple outgoing mailservers for multiple users?

Inschrijven

Ontvang een bericht wanneer er activiteit is op deze post

Deze vraag is gerapporteerd
mailmailserverodoo8.0
1 Beantwoorden
12995 Weergaven
Avatar
Yenthe Van Ginneken (Mainframe Monkey)

Hi guys,

Every now and then I play around with the mail module and the features but I seem to run stuck on one point, everytime.
Imagine that you have three users: UserA, UserB and UserC.
Its perfectly possible to configure an incoming mail server for every user (so three incoming mail servers) however when you want to create three outgoing mail servers the problems start.
You can create three different outgoing mailservers but the one with the highest priority will always be used, no matter what.

My question is, what is the correct way to create multiple outgoing mail servers and use all of them depending on the user that is sending an email? An example:

UserA wants to send a message to a customer which he has just created under 'Sales' > 'Contacts'. He types a messages and submits this. It will now be e-mailed with the outgoing mailserver with the lowest priority, lets assume this is OutgoingmailserverUserA.
When UserB now wants to send an email out to the same customer but from another e-mail (OutgoingmailserverUserB) it will be sent with the mailserver from OutgoingmailserverUserA, since this has the lowest priority.

How can I create multiple outgoing mailservers and send an e-mail out depending on the user? This feature does not seem to exist out of the box and the only option seems to be to have one outgoing mailserver for all users?..

Thanks,
Yenthe

2
Avatar
Annuleer
Futurelens

Use multiple outgoing mail servers for multiple users you can use this module: https://apps.odoo.com/apps/modules/14.0/fl_outgoing_mail_server_user/

Avatar
Emipro Technologies Pvt. Ltd.
Beste antwoord

Yenthe,

I have asked same question before few days :

https://www.odoo.com/forum/help-1/question/how-to-send-email-by-userwise-modelwise-using-differnent-outgoing-servers-87768

I made a module for this and added a many2one field in outgoing server ( ir.mail_server model ) At the time of send mail, i checked if there is no default mail_server_id available then system will get the related mail server from "uid".

For example, see following method. ( Please give attention to bold lines )

class ir_mail_server(osv.osv):
    _inherit = "ir.mail_server"
    _columns = {
                'user_id_ept':fields.many2one('res.users','User',help='When user is assigned then \
                                    at the time of email sending from Odoo if no outgoing server found then \
                                    system will take the server which is assigned to this user.') 
                }
    
    def send_email(self, cr, uid, message, mail_server_id=None, smtp_server=None, smtp_port=None,
                   smtp_user=None, smtp_password=None, smtp_encryption=None, smtp_debug=False,
                   context=None):
        mail_server = mail_server_id
        if not mail_server :
            user_obj = self.pool.get('res.users').browse(cr,uid,uid)
            email = user_obj.partner_id and user_obj.partner_id.email or False
            if email :
                mail_server_ids = self.search(cr, SUPERUSER_ID, [('user_id_ept','=',uid)], order='sequence', limit=1)
                if mail_server_ids :
                    mail_server = mail_server_ids[0]
        return super(ir_mail_server,self).send_email(cr, uid, message,
                                                    mail_server_id=mail_server,
                                                    context=context)  


In a nutshell, before Odoo checks low priority outgoing server in case of if there is no mail server specified, I added condition to check outgoing server related to user configured on it with "uid". ( this sentence may be hard to understand ;) )

From my thinking this is the only way. However in my question i raised another interesting point. If you have a time please read it as well.

Latest Update : This module is out to Odoo store now. It is a Free App. You can download from this link. 

3
Avatar
Annuleer
Yenthe Van Ginneken (Mainframe Monkey)
Auteur

Hi Emipro, thanks a lot for your reply! I was thinking about doing exactly the same and I see that as the only option too. Is your module available anywhere on Github or something? It would be a waste if I would have to program the entire thing again while you've made this. Perhaps this is something you could put online on apps? I honestly think this would be great. I'll upvote this for now but I'll leave the accepting open for other responses too. :)

Emipro Technologies Pvt. Ltd.

Yenthe, that module is already available at myside but with more specific features. Tonight I will make it separate and post in Odoo Apps for free to download. Also I will inform you to your email so you can download it. Give me your email. (y)

Yenthe Van Ginneken (Mainframe Monkey)
Auteur

Great Emipro! You can always drop me an e-mail at yenthe.vanginneken@vanroey.be , also to talk about other things regarding Odoo. Looking forward to your module, thanks!

Emipro Technologies Pvt. Ltd.

Yenthe, I sent you module on your specified email address. Enjoy !

Ricardo Gross

Could you please update the app link?

Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!

Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!

Aanmelden
Gerelateerde posts Antwoorden Weergaven Activiteit
Hostinger Mail - Odoo
mail mailserver
Avatar
0
mei 24
2991
Critical Problem: Odoo 14 auto responder loop to mails from unknown sender
mail mailserver
Avatar
0
mrt. 21
3633
Odoo 8 mail problems: Admin receives all messages / notification of new mails not working
mail odoo8.0
Avatar
0
jul. 16
4034
Automatic record creation fails on incoming mails
mail mailserver
Avatar
0
mrt. 16
4220
where can I find openerp_mailgate.py on v8? Opgelost
mail mailserver
Avatar
Avatar
Avatar
2
aug. 15
6444
Community
  • Tutorials
  • Documentatie
  • Forum
Open Source
  • Downloaden
  • Github
  • Runbot
  • Vertalingen
Diensten
  • Odoo.sh Hosting
  • Ondersteuning
  • Upgrade
  • Gepersonaliseerde ontwikkelingen
  • Onderwijs
  • Vind een boekhouder
  • Vind een partner
  • Word een Partner
Over ons
  • Ons bedrijf
  • Merkelementen
  • Neem contact met ons op
  • Vacatures
  • Evenementen
  • Podcast
  • Blog
  • Klanten
  • Juridisch • Privacy
  • Beveiliging
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo is een suite van open source zakelijke apps die aan al je bedrijfsbehoeften voldoet: CRM, E-commerce, boekhouding, inventaris, kassasysteem, projectbeheer, enz.

Odoo's unieke waardepropositie is om tegelijkertijd zeer gebruiksvriendelijk en volledig geïntegreerd te zijn.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now