有没有适合初学者免费邮寄表单的 PHP 脚本?
我希望用户在一个地方提交新闻通讯订阅电子邮件,并在一个地方提交完整的联系表单。除了知道它可以满足我的需要之外,零 PHP 知识。
I have a place where I want users to submit emails for newsletter subs and a place to submit an entire contact form. Zero php knowledge outside of know that it can do what I need.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
内置了邮件功能,看看
http://php.net/ Manual/en/function.mail.php
但是,当然,您需要使用发布的表单数据来格式化电子邮件正文。
There's a mail function built-in, take a look at
http://php.net/manual/en/function.mail.php
you will however, need to format the email body with the form data posted, of course.
查看 FormToEmail。从他们的网站:
Check out FormToEmail. From their site:
实际上,您不需要进行任何 php 编程来创建这样的设置。有很多可用的邮件列表软件应用程序,您可以获取 formmail 脚本(例如 Matt 的脚本存档中的脚本) )并使用正确的字段构建 html。
Actually, you don't need to do any php programming to create a such a setup. There are plenty of mailing list software apps available and you can grab a formmail script (like the one from Matt's Script Archive) and build the html with the right fields.
使用邮件功能。
但请注意,如果您想在电子邮件中使用 html,您需要自己指定正确的标头!
初学者常见的一个错误是假设您可以简单地在邮件中使用 html 标签,并且它应该自动工作。
我认为这一点值得一提,因为您想做一份时事通讯。如果您尝试发送电子邮件,并且原始 html 标签似乎出现在消息中,那么这就是您的问题:)
Use the mail function.
However be aware that you need to specify the correct headers yourself if you want to use html in your emails!
A common beginner's mistake is assuming you can simply use html tags with mail and it should work automatically.
Figured this was worth mentioning, since you are wanting to do a newsletter. If you try sending the email, and the raw html tags seem to appear in the message, this is your issue :)
作为一个对 PHP 一无所知的人,我经常寻找复杂问题的简单解决方案。使用超级简单的 PHP 表单可能会有一些缺点,例如,如果您没有任何措施来防止这种情况,则会收到大量垃圾邮件;如果您没有任何 PHP 知识,则很难设置这些措施。
这是我发现的,这里有一个脚本: http:// www.dagondesign.com/articles/secure-php-form-mailer-script/
您可以免费下载,并且开发人员似乎对如何安装和使用有很多指导。我能够设置它并让它工作......而不需要花费大量时间阅读和排除故障。希望对您有帮助。
As someone who is a PHP know-nothing, I often look for easy solutions to complex problems. Using a super simple PHP form can have some downsides such as getting massive amounts of spam if you don't have any measures to prevent that, setting up those measures is hard to do if you do not have any knowledge of PHP.
Here is what I found, there is a script here: http://www.dagondesign.com/articles/secure-php-form-mailer-script/
that you can download at no charge and the developer seems to have a lot guidance on how to install and use. I was able to set it up and get it to work.. not without having to spend quite of bit of time reading and trouble shooting. Hope that helps you.