mirror of
https://github.com/SpudGunMan/meshing-around.git
synced 2026-05-07 05:44:28 +02:00
Update smtp.py
This commit is contained in:
+13
-1
@@ -9,7 +9,7 @@ import smtplib
|
||||
from email.mime.text import MIMEText
|
||||
from email.mime.multipart import MIMEMultipart
|
||||
|
||||
# SMTP settings
|
||||
# SMTP settings (required for outbound email/sms)
|
||||
SMTP_SERVER = "smtp.gmail.com" # Replace with your SMTP server
|
||||
SMTP_PORT = 587 # 587 SMTP over TLS/STARTTLS, 25 legacy SMTP
|
||||
FROM_EMAIL = "your_email@gmail.com" # Sender email: be mindful of public access, don't use your personal email
|
||||
@@ -17,9 +17,21 @@ SMTP_USERNAME = "your_email@gmail.com" # Sender email username
|
||||
SMTP_PASSWORD = "your_app_password" # Sender email password
|
||||
EMAIL_SUBJECT = "Meshtastic✉️"
|
||||
|
||||
# IMAP settings (inbound email)
|
||||
enableImap = False
|
||||
IMAP_SERVER = "imap.gmail.com" # Replace with your IMAP server
|
||||
IMAP_PORT = 993 # 993 IMAP over TLS/SSL, 143 legacy IMAP
|
||||
IMAP_USERNAME = SMTP_USERNAME # IMAP username usually same as SMTP
|
||||
IMAP_PASSWORD = SMTP_PASSWORD # IMAP password usually same as SMTP
|
||||
IMAP_FOLDER = "inbox" # IMAP folder to monitor for new messages
|
||||
|
||||
trap_list_smtp = ("email", "setmail", "sms", "setsms")
|
||||
smtpThrottle = {}
|
||||
|
||||
if enableImap:
|
||||
import imaplib
|
||||
import email
|
||||
|
||||
# Send email
|
||||
def send_email(to_email, message):
|
||||
global smtpThrottle
|
||||
|
||||
Reference in New Issue
Block a user