And I want to add an email link. I’ve tried about 600 different ways and all I can get it to open is a blank page with my emails.
This one is with import subprocess.
def open_email(self):
subprocess.Popen(["start", "outlook", "mailto:" + email_address], shell=True)
# Call the form
if runme:
form = CreateWindow()
Application.Run(form)
form.open_email()
import webbrowser
class CreateWindow:
def open_email(self, email_address, subject, body):
mailto_link = f"mailto:{email_address}?subject={subject}&body={body}"
webbrowser.open(mailto_link)
# Example usage:
runme = True # Set this to your condition
if runme:
form = CreateWindow()
# Provide the email address, subject, and body for the email
form.open_email("recipient@example.com", "Your Subject", "Your email content goes here.")