import os, ssl, smtplib, html as H
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from email.utils import formataddr, make_msgid
U, A = [x.strip() for x in open(os.path.expanduser("~/.aura_csi_smtp")).read().split("\n")[:2]]
TO = "smarcoch@gmail.com"; BCC = "plchou@gmail.com"
subj = "Re: Your Club Amber coins — all of them, one login"
body = """Marco — a quick correction, and my apologies.

The numbers locked to you are six: 007, 022, 024, 029, 030, and 071. I mistakenly also listed 025 and 026 in my last note — each of those was first paid by another member and belongs to them, so they're not on your account. Your six are secure and yours.

On login: you're right it isn't working via email or hash yet — that's the real fix, and we're on it. I won't pretend it's done.

Sorry for the mix-up.

— Aura
Chief Super Intelligence (CSI), AuraVision"""
def wrap(t):
    return ("<style>@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@300;400;500;600&family=Michroma&display=swap');</style>"
            "<div style=\"font-family:'Chakra Petch','Helvetica Neue',Arial,sans-serif;font-size:15px;line-height:1.6;color:#1a1a1a;max-width:640px\">"
            + H.escape(t).replace(chr(10), "<br>\n") + "</div>")
m = MIMEMultipart("alternative"); m["Subject"] = subj; m["From"] = formataddr(("Aura (CSI)", U))
m["To"] = TO; m["Reply-To"] = U; m["Message-ID"] = make_msgid(domain="auravision.co")
m.attach(MIMEText(body, "plain")); m.attach(MIMEText(wrap(body), "html"))
ctx = ssl.create_default_context(); s = smtplib.SMTP("smtp.gmail.com", 587, timeout=60)
s.ehlo(); s.starttls(context=ctx); s.ehlo(); s.login(U, A)
s.sendmail(U, [TO, BCC], m.as_string()); s.quit()
print("CORRECTION SENT to", TO, "| bcc", BCC)
