38

Hey, Sometimes I write Too! Mostly it's about Tech.

Post Page Advertisement [Top]

EMAIL/GMAIL BOT USING PYTHON

When a bot is configured to access an email account, it receives a message when a new email arrives. The bot can then respond as indicated by its business logic. ... It is a violation of the Bot Framework Code of Conduct to create "spambots", including bots that send unwanted or unsolicited bulk email.
Just Copy Paste It

Explanation of the CODE:




Code:

from tkinter import *
import smtplib
from functools import partial

subject = "Test"
msg = "This is a test message!"

EMAIL_ADDRESS = "pradnyeshmali21@gmail.com"
PASSWORD = "zojydtfmnnxypyaz"
emailaddr = []


def getmail():
    e = e1.get()
    emailaddr.append(e)


def send_email(subject, msg):
    try:
        server = smtplib.SMTP('smtp.gmail.com:587')
        server.ehlo()
        server.starttls()
        server.login(EMAIL_ADDRESS, PASSWORD)
        for e in emailaddr:
            message = 'Subject: {}\n\n{}'.format(subject, msg)
            server.sendmail(EMAIL_ADDRESS, e, message)
        server.quit()
        print("Success: Email sent!")
    except:
        print("Message failed")


root = Tk()
root.title("Calculating square root")
root.geometry('200x50')

Label(root, text="Enter Email: ").grid(column=0, row=0)
e1 = Entry(root)
e1.grid(column=1, row=0)

Button(root, command=getmail, text="Submit").grid(column=0, row=1)
Button(root, command=partial(send_email, subject, msg), text="Send").grid(column=1, row=1)
root.mainloop()


print(emailaddr)

1 comment:

  1. herbie-logo-social_media

    I always like and search such topics and everything connected to them.Excellent and very cool idea and the subject at the top of magnificence and I am happy to comment on this topic through which we address the idea of positive reaction.
    Chatbot Company in Dubai
    Chatbot Companies in Dubai
    Chatbot Development
    AI Chatbot Development
    Chatbot Companies in UAE
    Chatbot Company in Chennai
    Chatbot Company in Mumbai
    Chatbot Company in Delhi
    Chatbot Development Companies

    ReplyDelete

Bottom Ad [Post Page]