Skip to content

Added Email, Google, YT function #927

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions JARVIS/JARVIS.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

# importing the pyttsx3 library
import pyttsx3
import smtplib
import webbrowser

# initialisation
engine = pyttsx3.init()
Expand All @@ -32,6 +34,14 @@
print(Query)


def sendEmail(do, content):
server = smtplib.SMTP('smtp.gmail.com', 587)
server.ehlo()
server.starttls()
server.login('[email protected]', 'yourr-password-here')
server.sendmail('[email protected]', to, content)
server.close()

# Run Application with Voice Command Function
def get_app(Q):
if Q == "time":
Expand All @@ -50,6 +60,23 @@ def get_app(Q):
subprocess.call(['cmd.exe'])
elif Q == "browser":
subprocess.call(['C:\Program Files\Internet Explorer\iexplore.exe'])
elif Q == "open google":
webbrowser.open("https://www.google.com")
elif Q == "open youtube":
webbrowser.open("https://www.youtube.com/")
elif Q == "Email to person":
try:
speak("What should I say?")
with sr.Microphone() as source:
print("Listening...")
r.pause_threshold = 1
audio = r.listen(source)
to = "[email protected]"
sendEmail(to, content)
speak("Email has been sent!")
except Exception as e:
print(e)
speak("Sorray i am not send this mail")
else:
engine.say("Sorry Try Again")
engine.runAndWait()
Expand Down