Django无需验证的联系表单

huangapple go评论49阅读模式
英文:

Django contact form with out requiring credentials

问题

我想知道是否有任何可接受的方法来创建一个简单的联系表单,以便客户可以直接向我发送电子邮件。我目前使用的方法需要我在settings.py中输入我的密码,我不明白为什么需要这样做,这肯定是不必要的。我无法在搜索引擎中找到其他方法。

英文:

my first question here, quite a a simple one I hope. I am wondering if there are any acceptable ways to create a simple contact form for clients to send an email directly to me. The current method I am using requires me to input my password into settings.py which I cannot understand why, surely this isn't necessary.

I cannot seem to find any other methods using search engines.

答案1

得分: 0

这不是那么简单。没有身份验证,邮件服务器怎么知道呢?
你不能创建自己的形式的 Gmail 用于用户发送电子邮件给你。
你可以创建一个表单,用户提交他们的详细信息,然后他们将从你在 settings.py 中设置的电子邮件地址收到邮件作为响应,当然需要密码。

有一个简单的替代方案,可以不使用你的联系表单,而是使用用户的默认邮件系统。
你可以使用 HTML 的 mailto 属性。

英文:

its not that simple. Without authentication how mail server will know?
you cant create your own form of gmail for User to Send you an Email.
You can do create form in which user will submit there details and they will get email as a response from your email which is set in your settings.py which ofc requires password.

there is a simple alternative you can use which wont use your contact form but it will use user's default mail system.
you can use html's mailto attribute.

huangapple
  • 本文由 发表于 2023年7月17日 20:26:35
  • 转载请务必保留本文链接:https://go.coder-hub.com/76704448.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定