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:
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
- You need to store the details in the database and make an admin panel to view the details from the database
- 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)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.