PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, July 14, 2022

[FIXED] How to recieve email from Contact Us from written with Flask

 July 14, 2022     email, flask, server, web-deployment, web-hosting     No comments   

Issue

I just created a Contact Us form using Flask. The code seems to work correclty as explained in many tutorials like this one: link.

The reason why it all works it is because at the beginning of the app file I need to insert the username and password of the person who is sending the mail (in this case it's me) through the form:

mail = Mail()
app.config["MAIL_SERVER"] = "smtp.gmail.com"
app.config["MAIL_PORT"] = 465
app.config["MAIL_USE_SSL"] = True
app.config["MAIL_USERNAME"] = 'my_personal_email0@gmail.com'
app.config["MAIL_PASSWORD"] = 'my_personal_password'
mail.init_app(app)

However once my website will be hosted online in some server, whoever wants to contact me trhough the form will just have the option to insert his email in the form and of course no password. Here it is what it looks like:

                               enter image description here

Would you be able to explain how this situation is handle once I host the website in some server? Is there something wrong with my logic?


Solution

You can do 2 things here

  1. You need to store the details in the database and make an admin panel to view the details from the database
  2. Create a fake Gmail and let that Gmail send you the users name, email subject, and message

I personally prefer the 1st option



Answered By - Programmer Gaurav
Answer Checked By - David Marino (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing