Proginst ufal mail

You're looking for a program to send an email using Python!

There are several ways to send an email using Python, but one popular library is smtplib. Here's a simple example to get you started:

Install the smtplib library

You can install smtplib using pip:

pip install smtplib

Send an email using smtplib

Here's an example code snippet:

import smtplib
from email.mime.text import MIMEText

# Define the email settings
SMTP_SERVER = "smtp.gmail.com"
SMTP_PORT = 587
FROM_EMAIL = "[email protected]"
PASSWORD = "your_password"

# Define the email message
SUBJECT = "Test Email"
BODY = "This is a test email sent using Python!"

# Create a text message
msg = MIMEText(BODY)
msg['Subject'] = SUBJECT
msg['From'] = FROM_EMAIL
msg['To'] = "[email protected]"

# Connect to the SMTP server
server = smtplib.SMTP(SMTP_SERVER, SMTP_PORT)
server.starttls()
server.login(FROM_EMAIL, PASSWORD)

# Send the email
server.sendmail(FROM_EMAIL, "[email protected]", msg.as_string())

# Close the SMTP connection
server.quit()

Note: