# Step Two copy Password For Generate time replace this YOUR_APP_PASSWORD
# Run this file example - python main.py
# Chake Your Terminal Show this message ✅Email sent successfully!
import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
# Zoho Mail credentials
password = "YOUR_APP_PASSWORD" # ⚠️ Use app password, not your normal login password
# Create the email
msg = MIMEMultipart()
msg["From"] = sender_email
msg["To"] = receiver_email
msg["Subject"] = "Test Email from Python via Zoho Mail"
# Email body
body = """\
Hi Sunil,
This is a test email sent from Python using Zoho Mail SMTP server.
Best regards,
Mr. Mishra
"""
msg.attach(MIMEText(body, "plain"))
# Send the email
try:
with smtplib.SMTP_SSL("smtp.zoho.in", 465) as server:
server.login(sender_email, password)
server.sendmail(sender_email, receiver_email, msg.as_string())
print("✅ Email sent successfully!")
except Exception as e:
print(f"❌ Error: {e}")