connect@howdiyworld.com
|

Text Mail Using Python(Automatic)

BLOCK DIAGRAM

Procedure

  1. Email ID Create and Make it Secure less
  2. Program
  3. Output

Procedure

E-mail secure less

  • First Create mail ID.
  • Make Secure less.
  • Replace the mail ID and Password in Python code.
  • Ctrl+S Save code.
  • Run the code.

Python Program

#LeaderPods

from time import sleep

from tkinter import *

from PIL import Image, ImageTk

from tkinter import messagebox

import os

import smtplib

from email import encoders

from email.mime.base import MIMEBase

from email.mime.multipart import MIMEMultipart

def mail_send():

messagebox.showinfo(“Check the Mail “, “Mail send")

def mail_not_send():

messagebox.showinfo(“Check the Mail “, “Unable to send the email.")

sender="Sender_MailID"

gmail_password="EmailID Password"

recipients="recipientmail@ahs.com"

message="""

Subject:Do It Champ

This is from Do-It-Champ"""

try:

with smtplib.SMTP(‘smtp.gmail.com’, 587) as s:

s.ehlo()

s.starttls()

s.ehlo()

s.login(sender, gmail_password)

s.sendmail(sender, recipients, message)

s.close()

# print(“Email sent!")

mail_send()

except:

#print(“Unable to send the email. Error: “, sys.exc_info()[0])

mail_not_send()

raise

Output

When Run the code and give an input on screen and click send button Mail will be send to receptor mail ID (Output Visible in Mobile VIA Mail).

Social media & sharing icons powered by UltimatelySocial
Facebook
Twitter
YouTube
LinkedIn
Instagram