Skip to content
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

SMTP email to the user ID #35

Closed
chauhannaman98 opened this issue May 24, 2020 · 3 comments · Fixed by #36
Closed

SMTP email to the user ID #35

chauhannaman98 opened this issue May 24, 2020 · 3 comments · Fixed by #36
Assignees
Labels
enhancement New feature or request Status: Completed

Comments

@chauhannaman98
Copy link
Owner

Add new user registration to the application and forget password system

@chauhannaman98 chauhannaman98 added the enhancement New feature or request label May 24, 2020
@chauhannaman98 chauhannaman98 self-assigned this May 24, 2020
@chauhannaman98
Copy link
Owner Author

Tested code to be integrated with project files

import smtplib, random, string
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart

toaddrs = input("Enter your email ID: ")
fromaddr = '[email protected]'
x = ''.join(random.choices(string.ascii_letters + string.digits, k=12))

message = MIMEMultipart("alternative")
message["Subject"] = "Forgot Password | MedFixture"
message["From"] = fromaddr
message["To"] = toaddrs

html = """\
<html>
	<body>
		<h1>Hi! Seems like you forgot you password. </h1>
			<p>Your verification code is <b>"""+ x +"""</b></p>
	</body>
</html>
"""

part1 = MIMEText(html, "html")
message.attach(part1)

username = fromaddr
password = 'paswd'

try:
	server = smtplib.SMTP('smtp.gmail.com:587')
	server.ehlo()
	server.starttls()
	server.login(username,password)
	server.sendmail(fromaddr, toaddrs, message.as_string())
except Exception as e:
	print(e)
finally:
	server.quit()

in_code = input("Enter the verification code: ")
if in_code == x:
	print("Verification successful")
else:
	print("Enter correct verification code")

@chauhannaman98 chauhannaman98 added the Status: Doing Issue being addressed and updates will be pushed soon label May 24, 2020
chauhannaman98 added a commit that referenced this issue May 24, 2020
chauhannaman98 added a commit that referenced this issue May 24, 2020
@chauhannaman98
Copy link
Owner Author

Gmail doesn't render <style> HTML tags in emails. I don't know the reason why??
But it does render the in-line styling within each tag. It is time-consuming to write inline styling for each tag in the HTML. Thus, click here for generating in-line HTML equivalent code. It will convert <style> tag inside <head> to in-line styling equivalent.

@chauhannaman98
Copy link
Owner Author

This issue is an extension of issue #26 addressing password recovery system using email verification.

@chauhannaman98 chauhannaman98 pinned this issue May 25, 2020
@chauhannaman98 chauhannaman98 added Status: Completed and removed Status: Doing Issue being addressed and updates will be pushed soon labels May 27, 2020
chauhannaman98 added a commit that referenced this issue Jun 1, 2020
* Added Travis CI config file

* Configured files for Travis build tests

* Changed Travis config for build test

* Added PIL install to Travis

* Update README.md

* Update README.md

* Update README.md

* Create pythonapp.yml

* Delete pythonapp.yml

* Update README.md

* Linking windows to the master file

* Minor UI Adjustments

* Added dropdown menu to form & UI changes

* Minor UI adjustments

* Change in UX and window resize

* Minor change to window

* Added new delete window

* Linked delete.py to the master.py

* Update README.md

* Update README.md

* Added the screenshots for documentation

* Fixed minor UI issue

* Binding submit button to return key

* Replaced SS after minor UI changes

* Replaced SS after minor UI fixing

* Deleting old SS

* Added new screenshots

* Update README.md

* Update the documentation

* Update README.md

Added about the project and features to the documentation

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Set theme jekyll-theme-hacker

* Enable download buttons

* Add jemoji plugin for inline emojis

* Added code for #35

* Delete SMTP-test.py

* New test code #35

* Added CSS with HTML email

* Update the email

* Delete SMTP-test.py

* Added HTML code for email

* Added password recovery using reg email ID

* Update DB schema

* Added new screenshots

* Minor bug fix and button disabling added
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Status: Completed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant