init commit
This commit is contained in:
BIN
helpers/__pycache__/send_email.cpython-313.pyc
Normal file
BIN
helpers/__pycache__/send_email.cpython-313.pyc
Normal file
Binary file not shown.
17
helpers/send_email.py
Normal file
17
helpers/send_email.py
Normal file
@@ -0,0 +1,17 @@
|
||||
import smtplib
|
||||
|
||||
# --- HELPER TRIMITE EMAIL (GMAIL) ---
|
||||
def send_gmail(to_email, subject, body):
|
||||
# Folosește App Password-ul tău de la Google aici
|
||||
user = "macamete.robert@gmail.com"
|
||||
pw = "advx yqlv jkaa czvr"
|
||||
msg = f"Subject: {subject}\nContent-Type: text/html\n\n{body}"
|
||||
try:
|
||||
server = smtplib.SMTP_SSL('smtp.gmail.com', 465)
|
||||
server.login(user, pw)
|
||||
server.sendmail(user, to_email, msg)
|
||||
server.quit()
|
||||
return True
|
||||
except Exception as e:
|
||||
print(f"Eroare mail: {e}")
|
||||
return False
|
||||
Reference in New Issue
Block a user