diff --git a/Control Oficios Conectividad 2025 .xlsx b/Control Oficios Conectividad 2025 .xlsx index 654d4fb..f77c979 100644 Binary files a/Control Oficios Conectividad 2025 .xlsx and b/Control Oficios Conectividad 2025 .xlsx differ diff --git a/Docs/TELECOM-CS-0002-2025.pdf b/Docs/TELECOM-CS-0002-2025.pdf new file mode 100644 index 0000000..5298c99 Binary files /dev/null and b/Docs/TELECOM-CS-0002-2025.pdf differ diff --git a/Docs/TELECOM-CS-0003-2025.pdf b/Docs/TELECOM-CS-0003-2025.pdf new file mode 100644 index 0000000..5298c99 Binary files /dev/null and b/Docs/TELECOM-CS-0003-2025.pdf differ diff --git a/Docs/TELECOM-CS-0004-2025.pdf b/Docs/TELECOM-CS-0004-2025.pdf new file mode 100644 index 0000000..5298c99 Binary files /dev/null and b/Docs/TELECOM-CS-0004-2025.pdf differ diff --git a/Docs/TELECOM-CS-0005-2025.pdf b/Docs/TELECOM-CS-0005-2025.pdf new file mode 100644 index 0000000..5298c99 Binary files /dev/null and b/Docs/TELECOM-CS-0005-2025.pdf differ diff --git a/Docs/TELECOM-CS-0006-2025.pdf b/Docs/TELECOM-CS-0006-2025.pdf new file mode 100644 index 0000000..5298c99 Binary files /dev/null and b/Docs/TELECOM-CS-0006-2025.pdf differ diff --git a/Docs/TELECOM-CS-0007-2025.pdf b/Docs/TELECOM-CS-0007-2025.pdf new file mode 100644 index 0000000..5298c99 Binary files /dev/null and b/Docs/TELECOM-CS-0007-2025.pdf differ diff --git a/Docs/TELECOM-CS-0008-2025.pdf b/Docs/TELECOM-CS-0008-2025.pdf new file mode 100644 index 0000000..5298c99 Binary files /dev/null and b/Docs/TELECOM-CS-0008-2025.pdf differ diff --git a/Docs/TELECOM-CS-0009-2025.pdf b/Docs/TELECOM-CS-0009-2025.pdf new file mode 100644 index 0000000..5298c99 Binary files /dev/null and b/Docs/TELECOM-CS-0009-2025.pdf differ diff --git a/Docs/TELECOM-CS-0010-2025.pdf b/Docs/TELECOM-CS-0010-2025.pdf new file mode 100644 index 0000000..5298c99 Binary files /dev/null and b/Docs/TELECOM-CS-0010-2025.pdf differ diff --git a/Docs/TELECOM-CS-0011-2025.pdf b/Docs/TELECOM-CS-0011-2025.pdf new file mode 100644 index 0000000..5298c99 Binary files /dev/null and b/Docs/TELECOM-CS-0011-2025.pdf differ diff --git a/Docs/TELECOM-CS-0012-2025.pdf b/Docs/TELECOM-CS-0012-2025.pdf new file mode 100644 index 0000000..5298c99 Binary files /dev/null and b/Docs/TELECOM-CS-0012-2025.pdf differ diff --git a/Docs/TELECOM-CS-0013-2025.pdf b/Docs/TELECOM-CS-0013-2025.pdf new file mode 100644 index 0000000..5298c99 Binary files /dev/null and b/Docs/TELECOM-CS-0013-2025.pdf differ diff --git a/Docs/TELECOM-CS-0014-2025.pdf b/Docs/TELECOM-CS-0014-2025.pdf new file mode 100644 index 0000000..5298c99 Binary files /dev/null and b/Docs/TELECOM-CS-0014-2025.pdf differ diff --git a/Docs/TELECOM-CS-0015-2025.pdf b/Docs/TELECOM-CS-0015-2025.pdf new file mode 100644 index 0000000..5298c99 Binary files /dev/null and b/Docs/TELECOM-CS-0015-2025.pdf differ diff --git a/Docs/TELECOM-CS-0016-2025.pdf b/Docs/TELECOM-CS-0016-2025.pdf new file mode 100644 index 0000000..5298c99 Binary files /dev/null and b/Docs/TELECOM-CS-0016-2025.pdf differ diff --git a/Docs/TELECOM-CS-0017-2025.pdf b/Docs/TELECOM-CS-0017-2025.pdf new file mode 100644 index 0000000..5298c99 Binary files /dev/null and b/Docs/TELECOM-CS-0017-2025.pdf differ diff --git a/Docs/TELECOM-CS-0018-2025.pdf b/Docs/TELECOM-CS-0018-2025.pdf new file mode 100644 index 0000000..5298c99 Binary files /dev/null and b/Docs/TELECOM-CS-0018-2025.pdf differ diff --git a/Docs/TELECOM-CS-0019-2025.pdf b/Docs/TELECOM-CS-0019-2025.pdf new file mode 100644 index 0000000..5298c99 Binary files /dev/null and b/Docs/TELECOM-CS-0019-2025.pdf differ diff --git a/Docs/TELECOM-CS-0020-2025.pdf b/Docs/TELECOM-CS-0020-2025.pdf new file mode 100644 index 0000000..5298c99 Binary files /dev/null and b/Docs/TELECOM-CS-0020-2025.pdf differ diff --git a/Docs/TELECOM-CS-0021-2025.pdf b/Docs/TELECOM-CS-0021-2025.pdf new file mode 100644 index 0000000..5298c99 Binary files /dev/null and b/Docs/TELECOM-CS-0021-2025.pdf differ diff --git a/Docs/TELECOM-CS-0022-2025.pdf b/Docs/TELECOM-CS-0022-2025.pdf new file mode 100644 index 0000000..5298c99 Binary files /dev/null and b/Docs/TELECOM-CS-0022-2025.pdf differ diff --git a/Docs/TELECOM-CS-0023-2025.pdf b/Docs/TELECOM-CS-0023-2025.pdf new file mode 100644 index 0000000..5298c99 Binary files /dev/null and b/Docs/TELECOM-CS-0023-2025.pdf differ diff --git a/Docs/TELECOM-CS-0024-2025.pdf b/Docs/TELECOM-CS-0024-2025.pdf new file mode 100644 index 0000000..5298c99 Binary files /dev/null and b/Docs/TELECOM-CS-0024-2025.pdf differ diff --git a/Docs/TELECOM-CS-0025-2025.pdf b/Docs/TELECOM-CS-0025-2025.pdf new file mode 100644 index 0000000..5298c99 Binary files /dev/null and b/Docs/TELECOM-CS-0025-2025.pdf differ diff --git a/Docs/TELECOM-CS-0026-2025.pdf b/Docs/TELECOM-CS-0026-2025.pdf new file mode 100644 index 0000000..5298c99 Binary files /dev/null and b/Docs/TELECOM-CS-0026-2025.pdf differ diff --git a/Docs/TELECOM-CS-0027-2025.pdf b/Docs/TELECOM-CS-0027-2025.pdf new file mode 100644 index 0000000..5298c99 Binary files /dev/null and b/Docs/TELECOM-CS-0027-2025.pdf differ diff --git a/Docs/TELECOM-CS-0028-2025.pdf b/Docs/TELECOM-CS-0028-2025.pdf new file mode 100644 index 0000000..5298c99 Binary files /dev/null and b/Docs/TELECOM-CS-0028-2025.pdf differ diff --git a/Docs/TELECOM-CS-0029-2025.pdf b/Docs/TELECOM-CS-0029-2025.pdf new file mode 100644 index 0000000..5298c99 Binary files /dev/null and b/Docs/TELECOM-CS-0029-2025.pdf differ diff --git a/Docs/TELECOM-CS-0030-2025.pdf b/Docs/TELECOM-CS-0030-2025.pdf new file mode 100644 index 0000000..5298c99 Binary files /dev/null and b/Docs/TELECOM-CS-0030-2025.pdf differ diff --git a/Docs/TELECOM-CS-0031-2025.pdf b/Docs/TELECOM-CS-0031-2025.pdf new file mode 100644 index 0000000..5298c99 Binary files /dev/null and b/Docs/TELECOM-CS-0031-2025.pdf differ diff --git a/Docs/TELECOM-CS-0032-2025.pdf b/Docs/TELECOM-CS-0032-2025.pdf new file mode 100644 index 0000000..5298c99 Binary files /dev/null and b/Docs/TELECOM-CS-0032-2025.pdf differ diff --git a/Docs/TELECOM-CS-0033-2025.pdf b/Docs/TELECOM-CS-0033-2025.pdf new file mode 100644 index 0000000..5298c99 Binary files /dev/null and b/Docs/TELECOM-CS-0033-2025.pdf differ diff --git a/Docs/TELECOM-CS-0034-2025.pdf b/Docs/TELECOM-CS-0034-2025.pdf new file mode 100644 index 0000000..5298c99 Binary files /dev/null and b/Docs/TELECOM-CS-0034-2025.pdf differ diff --git a/Docs/TELECOM-CS-0035-2025.pdf b/Docs/TELECOM-CS-0035-2025.pdf new file mode 100644 index 0000000..5298c99 Binary files /dev/null and b/Docs/TELECOM-CS-0035-2025.pdf differ diff --git a/Docs/TELECOM-CS-0036-2025.pdf b/Docs/TELECOM-CS-0036-2025.pdf new file mode 100644 index 0000000..5298c99 Binary files /dev/null and b/Docs/TELECOM-CS-0036-2025.pdf differ diff --git a/Docs/TELECOM-CS-0037-2025.pdf b/Docs/TELECOM-CS-0037-2025.pdf new file mode 100644 index 0000000..5298c99 Binary files /dev/null and b/Docs/TELECOM-CS-0037-2025.pdf differ diff --git a/Docs/TELECOM-CS-0038-2025.pdf b/Docs/TELECOM-CS-0038-2025.pdf new file mode 100644 index 0000000..5298c99 Binary files /dev/null and b/Docs/TELECOM-CS-0038-2025.pdf differ diff --git a/Docs/TELECOM-CS-0039-2025.pdf b/Docs/TELECOM-CS-0039-2025.pdf new file mode 100644 index 0000000..5298c99 Binary files /dev/null and b/Docs/TELECOM-CS-0039-2025.pdf differ diff --git a/Docs/TELECOM-CS-0040-2025.pdf b/Docs/TELECOM-CS-0040-2025.pdf new file mode 100644 index 0000000..5298c99 Binary files /dev/null and b/Docs/TELECOM-CS-0040-2025.pdf differ diff --git a/Docs/TELECOM-CS-0041-2025.pdf b/Docs/TELECOM-CS-0041-2025.pdf new file mode 100644 index 0000000..5298c99 Binary files /dev/null and b/Docs/TELECOM-CS-0041-2025.pdf differ diff --git a/Docs/test.pdf b/Docs/test.pdf new file mode 100644 index 0000000..5298c99 Binary files /dev/null and b/Docs/test.pdf differ diff --git a/Propuesta de Respuesta a Solicitudes CFE-TEIT.docx b/Propuesta de Respuesta a Solicitudes CFE-TEIT.docx deleted file mode 100644 index 9835830..0000000 Binary files a/Propuesta de Respuesta a Solicitudes CFE-TEIT.docx and /dev/null differ diff --git a/Respuesta_asunto_presidencia.docx b/Respuesta_asunto_presidencia.docx new file mode 100644 index 0000000..93ae4ee Binary files /dev/null and b/Respuesta_asunto_presidencia.docx differ diff --git a/img_cfe/logo.png b/img_cfe/logo.png new file mode 100644 index 0000000..36d11d7 Binary files /dev/null and b/img_cfe/logo.png differ diff --git a/img_cfe/logo.svg b/img_cfe/logo.svg new file mode 100644 index 0000000..0d6ca85 --- /dev/null +++ b/img_cfe/logo.svg @@ -0,0 +1,341 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..e69de29 diff --git a/main.py b/main.py index f2f0773..ef5cebc 100644 --- a/main.py +++ b/main.py @@ -2,6 +2,7 @@ import smtplib from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from email.mime.base import MIMEBase +from email.mime.image import MIMEImage from email import encoders import os import pandas as pd @@ -19,19 +20,75 @@ def determinar_periodo(): else: return "Madrugada" - -def build_message(saludo_hora, destinatarios, nombre_destinatario, file_path, email_usuario): - msg = MIMEMultipart() +def build_message(saludo_hora, destinatarios, file_path, email_usuario, oficio_numero): + msg = MIMEMultipart("related") msg["From"] = email_usuario msg["To"] = ", ".join(destinatarios) - msg["Subject"] = "Respuesta a solicitud de conectividad" + msg["Subject"] = f"Respuesta a solicitud de conectividad, oficio número: {oficio_numero}" + + # Abre y lee la imagen del logo + with open("./img_cfe/logo.png", "rb") as fp: + logo_img = MIMEImage(fp.read(), "svg+xml") # Tipo de imagen para SVG + + # 📌 Asigna un ID único y un nombre de archivo + logo_img.add_header("Content-ID", "") + logo_img.add_header("Content-Disposition", "inline", filename="logo.png") + msg.attach(logo_img) - cuerpo = ( - f"{saludo_hora} {nombre_destinatario};\n\n" - "Por medio del presente se le hace llegar la respuesta a su solicitud de conectividad, " - "adjunto encontrará el documento en mención.\n\nSaludos cordiales." - ) - msg.attach(MIMEText(cuerpo, "plain")) + + # 📝 Código HTML para el cuerpo del correo + cuerpo_html = f""" + + + + Respuesta a solicitud de conectividad + + + + + + + + + +
+ + + + + + + + + + + + + + +
+ + + """ + + # 📌 Cambia 'plain' a 'html' para el tipo de contenido + msg.attach(MIMEText(cuerpo_html, "html")) if os.path.exists(file_path): with open(file_path, "rb") as adj: @@ -45,7 +102,6 @@ def build_message(saludo_hora, destinatarios, nombre_destinatario, file_path, em return msg - def main(): email_usuario = "david.itehua@aem.gob.mx" app_password = "lcdq hwvq wxxa pbcn" @@ -54,7 +110,8 @@ def main(): # Carga de Excel file_xlsx = "./Control Oficios Conectividad 2025 .xlsx" - df = pd.read_excel(file_xlsx)[["No", "FECHA DE RECEPCION", "REMITENTE", "ASUNTO", "CORREO ELECTRÓNICO", "FILE_TO_SEND"]] + # df = pd.read_excel(file_xlsx)[["No", "FECHA DE RECEPCION", "REMITENTE", "ASUNTO", "CORREO ELECTRÓNICO", "Oficio_no", "documento"]] + df = pd.read_excel(file_xlsx, dtype={'Oficio_no': str})[["No", "FECHA DE RECEPCION", "REMITENTE", "ASUNTO", "CORREO ELECTRÓNICO", "Oficio_no", "documento"]] saludo = determinar_periodo() @@ -63,20 +120,18 @@ def main(): server.login(email_usuario, app_password) for _, row in tqdm(df.iterrows(), total=len(df), desc="Enviando correos"): - # Normaliza separadores emails_raw = str(row["CORREO ELECTRÓNICO"]) destinatarios = [e.strip() for e in emails_raw.replace(";", ",").split(",") if e.strip()] - file_to_send = row["FILE_TO_SEND"] + file_to_send = f'./Docs/{row["documento"]}' + oficio_numero = row["Oficio_no"] - msg = build_message(saludo, destinatarios, row["REMITENTE"], file_to_send, email_usuario) + msg = build_message(saludo, destinatarios, file_to_send, email_usuario, oficio_numero) try: server.send_message(msg, from_addr=email_usuario, to_addrs=destinatarios) - # print(f"✅ Correo enviado a: {', '.join(destinatarios)}") except Exception as e: print(f"❌ Error enviando a {destinatarios}: {e}") - if __name__ == "__main__": - main() + main() \ No newline at end of file