fix(email): fix UnicodeEncodeError in print output, format App Password without spaces, add UTF-8 sys.stdout reconfigure
Some checks failed
Deploy RIT Freshers Hub to VPS / Deploy to Live VPS (push) Has been cancelled
Some checks failed
Deploy RIT Freshers Hub to VPS / Deploy to Live VPS (push) Has been cancelled
This commit is contained in:
@@ -18,7 +18,7 @@ Two core scripts were added to the repository under the [`scripts/`](file:///f:/
|
||||
| Parameter | Value |
|
||||
| :--- | :--- |
|
||||
| **Sender Email** | `krishnaowoxd@gmail.com` |
|
||||
| **App Password** | `qkwy lwtc snlr pree` |
|
||||
| **App Password** | `qkwylwtcsnlrpree` (no spaces) |
|
||||
| **Recipient Email** | `dorutoslayer@gmail.com` |
|
||||
| **SMTP Host / Port** | `smtp.gmail.com:587` (TLS) |
|
||||
|
||||
|
||||
@@ -4,11 +4,15 @@ import os
|
||||
from email.mime.text import MIMEText
|
||||
from email.mime.multipart import MIMEMultipart
|
||||
|
||||
# Ensure UTF-8 output for terminal/logging
|
||||
if hasattr(sys.stdout, 'reconfigure'):
|
||||
sys.stdout.reconfigure(encoding='utf-8')
|
||||
|
||||
# Load configuration from environment or fallback defaults
|
||||
SMTP_SERVER = os.environ.get("SMTP_SERVER", "smtp.gmail.com")
|
||||
SMTP_PORT = int(os.environ.get("SMTP_PORT", 587))
|
||||
SENDER_EMAIL = os.environ.get("SENDER_EMAIL", "krishnaowoxd@gmail.com")
|
||||
SENDER_PASSWORD = os.environ.get("SENDER_PASSWORD", "qkwy lwtc snlr pree")
|
||||
SENDER_PASSWORD = os.environ.get("SENDER_PASSWORD", "qkwylwtcsnlrpree").replace(" ", "")
|
||||
RECIPIENT_EMAIL = os.environ.get("RECIPIENT_EMAIL", "dorutoslayer@gmail.com")
|
||||
|
||||
if len(sys.argv) < 7:
|
||||
|
||||
Reference in New Issue
Block a user