Commit 23e50b59 by juan

Mejora envio con copia a mail

1 parent e358019c
......@@ -33,6 +33,9 @@ class ValidacionCorreo():
Correo = Correo.replace(" ","")
Correo = Correo.replace("\t","")
Correo = Correo.replace("\n","")
Correo = Correo.replace(";",",")
if len(Correo.split(",")) > 1:
return(Correo)
if self.validarcorreo(Correo) == False:
Correo = False
return(Correo)
......
......@@ -128,6 +128,7 @@ class Mail(ServiceBase):
host = info["smtp"]["host"]
except:
host = False
#Aca inserto deteccion de multiples objetivos
if host == "MAILMASIVO":
res = self.sendGrid(info, data)
return(res)
......@@ -141,8 +142,11 @@ class Mail(ServiceBase):
msg = MIMEMultipart()
Cr = ValidacionCorreo()
msg['From'] = self.Usuario(info)
msg['To'] = Cr.ValidarCorreo(data[Table.dest])
destino = data[Table.dest]
#print(destino)
msg['Subject'] = info['subject']
msg["To"] = Cr.ValidarCorreo(destino)
print("destino",msg["To"])
succ = {}
if msg['To'] == False:
print("mail no sale")
......@@ -156,7 +160,12 @@ class Mail(ServiceBase):
succ[file] = True
try:
if not msg['From'] in stadomail.MailRompedor:
#Multienvio
#for destino in msg['To'].split(","):
# Msg = msg.copy()
# Msg["To"] = Cr.ValidarCorreo(destino)
self.Envio(msg,info,stadomail)
#self.Envio(msg,info,stadomail)
else:
succ[file] = False
except Exception as E:
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!