What is the configuration to send email

hola… para enviar correos se debe de modificar algo?

https://docs.tryton.org/projects/server/en/latest/topics/configuration.html#email

This is all I use to send e-mails in the config file:

[email]
smtp://email-server
from="Sender Name" <address>

where email-server is your e-mail server hostname/ip and from the the sender address.

Edit: You may test your configuration using trytond-admin:
trytond-admin --test-email TEST_EMAIL

1 Like

no me funciono nose que estoy poniendo mal

Unfortunately, this example is wrong: This is not a valid config-file syntax and from is missing the actual address. A valid example is

[smtp]
uri: smtp://your.smtp-server.com
from: “Sender Name” <info@example.com>
1 Like

Yes, it is wrong because I have no idea how this forum modifies what I write :slight_smile:
Fixed now, thanks for the notification.

el email server es propio de tryton o se pone otro servidor de correo??

Hi Silviano,

Tryton does not have any email server it uses an external SMTP server to delivery email.
To do so you should configure the server and credentials to be used as already suggested on the thread.

ya se que es mucho pedir pero lo puedes escribir con un ejemplo real esque me sigue marcando errores

ya lo coloque y en el sao no me marca errores, pero me marca errores en un archivos de phyton

Hi Silvano,

Could you share the errors you have? Otherwise we can not do anything.

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/trytond/sendmail.py", line 39, in sendmail
    senderrs = server.sendmail(from_addr, to_addrs, msg.as_string())
  File "/usr/lib/python3.8/smtplib.py", line 871, in sendmail
    raise SMTPSenderRefused(code, resp, from_addr)
smtplib.SMTPSenderRefused: (451, b'5.7.3 STARTTLS is required to send mail [SN7PR04CA0196.namprd04.prod.outlook.com]', '"Silviano Torres" <centerd_1998@hotmail.com>')
5118 140458365802240 [2021-03-04 15:38:43,785] CRITICAL trytond.transaction A datamanager raised an exception in tpc_finish, the data might be inconsistant
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/trytond/transaction.py", line 234, in commit
    datamanager.tpc_finish(self)
  File "/usr/local/lib/python3.8/dist-packages/trytond/sendmail.py", line 126, in tpc_finish
    self._server.quit()
  File "/usr/lib/python3.8/smtplib.py", line 988, in quit
    res = self.docmd("quit")
  File "/usr/lib/python3.8/smtplib.py", line 424, in docmd
    self.putcmd(cmd, args)
  File "/usr/lib/python3.8/smtplib.py", line 371, in putcmd
    self.send(str)
  File "/usr/lib/python3.8/smtplib.py", line 363, in send
    raise SMTPServerDisconnected('please run connect() first')
smtplib.SMTPServerDisconnected: please run connect() first
5118 140458365802240 [2021-03-04 15:38:43,787] ERROR trytond.sendmail fail to send email
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/trytond/sendmail.py", line 39, in sendmail
    senderrs = server.sendmail(from_addr, to_addrs, msg.as_string())
  File "/usr/lib/python3.8/smtplib.py", line 865, in sendmail
    (code, resp) = self.mail(from_addr, esmtp_opts)
  File "/usr/lib/python3.8/smtplib.py", line 538, in mail
    self.putcmd("mail", "FROM:%s%s" % (quoteaddr(sender), optionlist))
  File "/usr/lib/python3.8/smtplib.py", line 371, in putcmd
    self.send(str)
  File "/usr/lib/python3.8/smtplib.py", line 363, in send
    raise SMTPServerDisconnected('please run connect() first')
smtplib.SMTPServerDisconnected: please run connect() first
5118 140458365802240 [2021-03-04 15:38:43,788] CRITICAL trytond.transaction A datamanager raised an exception in tpc_finish, the data might be inconsistant
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/trytond/transaction.py", line 234, in commit
    datamanager.tpc_finish(self)
  File "/usr/local/lib/python3.8/dist-packages/trytond/sendmail.py", line 126, in tpc_finish
    self._server.quit()
  File "/usr/lib/python3.8/smtplib.py", line 988, in quit
    res = self.docmd("quit")
  File "/usr/lib/python3.8/smtplib.py", line 424, in docmd
    self.putcmd(cmd, args)
  File "/usr/lib/python3.8/smtplib.py", line 371, in putcmd
    self.send(str)
  File "/usr/lib/python3.8/smtplib.py", line 363, in send
    raise SMTPServerDisconnected('please run connect() first')
smtplib.SMTPServerDisconnected: please run connect() first

ese es el error que me arroja.

STARTTLS is required to communicate with your server. So you must use smtp+tls://… (see Configuration file for Tryton — trytond latest documentation)