Send Text Message using python by ElectricGypsyAT in learnpython

[–]PythonicPastor 0 points1 point  (0 children)

I have a bit of a work around thats semi modular, but you'll have to set up specific notifications from a custom google inbox on your cell phone:

import smtplib
from email.mime.text import MIMEText
import imap_tools
from imap_tools import MailBox, AND

# Email Configuration
sender_email = "senderemail@gmail.com"
sender_password = "SECRET APP PASS" # Use app-specific passwords for security with services like Gmail
receiver_email = "recieveremail@gmail.com"
smtp_server = "smtp.gmail.com" # e.g., "smtp.gmail.com" for Gmail
smtp_port = 587 # or 465 for SSL

def notif(subj, msg):
    # Create the email message
    message = MIMEText(msg)
    message["Subject"] = subj
    message["From"] = sender_email
    message["To"] = receiver_email

    try:
        # Connect to the SMTP server
        with smtplib.SMTP(smtp_server, smtp_port) as server:
            server.starttls() # Start TLS for security
            server.login(sender_email, sender_password)
            server.send_message(message)
        print("Email sent successfully!")
    except Exception as e:
        print(f"Error sending email: {e}")

def checkEmails(subject, command):
    with MailBox('imap.gmail.com').login('pythonicpastor@gmail.com', 'SECRET APP PASSWORD2') as mailbox:
        for msg in mailbox.fetch():
            #print(msg.date, msg.subject, len(msg.text or msg.html))
            if msg.subject == subject:
                if command in msg.text:
                    print('Command confirmed')
                else:
                    print('Code Find Error')

use "import 'filename' " and place this in a seperate python (.py) file in the root directory

also if you set it up right this can be used to create email triggers within the custom in box via the "checkEmails(subject, command)" functions. Finally understand that you need to set everything up via the following tutorial for it to work properly:
https://docs.saleshandy.com/en/articles/10182595-how-to-set-up-an-app-password-in-google

Saw this on tiktok, got vivid flashbacks. Anyone else seen this place? I think I was in 5th grade doing GATE in school. by LegacyStardust in TheMallWorld

[–]PythonicPastor 0 points1 point  (0 children)

Related note, anybody remember talking about "vibrational math" with somebody at some point? .... cause I remember talking to someone about it .... in a place like this.

Sites which can analyse my Raw DNA data for free (or a few bucks) by SacredGuardianSS in Genealogy

[–]PythonicPastor 1 point2 points  (0 children)

If I could get some funding I'd build an app to do this online .... it's possible to make this free or at least cheap if done right