我应该使用 formmail 还是 PHP 邮件?
我最近开始从事一个已经在进行中的网络项目;为其奠定基础的人让注册页面将表单字段发送到 formmail Perl 脚本,这样他就可以在用户注册时收到一封电子邮件。我对 Perl 不熟悉,我倾向于只使用 PHP mail() 函数并放弃 Perl 脚本,而不是花时间尝试弄清楚如何正确使用它。
那么,是否有任何充分的理由继续使用 Perl 脚本,或者我应该建议他放弃它而转而使用 PHP 邮件?有什么优点和缺点,还是完全主观的?
我意识到这个问题可能被标记为主观问题;只是寻求建议。
I recently started working on a web project which was already in progress; the guy who built the foundation for it had the signup page sending the form fields to a formmail Perl script, so that he could get an email when a user signs up. I'm not familiar with Perl, and my inclination is to just use the PHP mail() function and drop the Perl script, rather than spend time trying to figure out how to use it correctly.
So, is there any good reason to keep using the Perl script, or should I just advise him to drop it in favor of PHP mail? Any pros and cons, or is it entirely subjective?
I realize that this question may be flagged as subjective; just looking for advice.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果通过 formmail,您的意思是 formmail 立即删除它,并替换为更好设计和编写的内容,例如 < a href="http://nms-cgi.sourceforge.net/faq_nms.html#But_there_are_perfectly_good_programs_already_out_there_why_bother" rel="noreferrer">nms TFMail。
我不知道任何关于“php mail”的评论。
If by formmail, you mean formmail drop it immediately, and replace with something better designed and written like nms TFMail.
I do not know anything about said "php mail" to comment on that.
我推荐第三种选择:外部 PHP 邮件程序类,例如 PHPMailer。这为您提供了不必混合语言以及不必弄清楚
mail()
的怪癖的优势。如果需要,它还可以执行 SMTP 电子邮件本身之类的操作,并且可以组合附件和备用部分。mail()
无法做到这一点。PHP的
mail()
函数需要捕获并拍摄。它是 PHP 拥有的最古怪和奇怪的函数之一,需要了解 SMTP 和 MIME 通常如何工作才能调用。如果您确实想要弄清楚如何使用,请在了解后将其放在 API 调用后面。I'd recommend a third option: an external PHP mailer class, such as PHPMailer. This gives you the advantage of not mixing languages unnecessarily as well as not having to figure out the quirks of
mail()
. It also does things like SMTP email itself, if required, and can assemble attachments and alternate sections.mail()
can do none of that.PHP's
mail()
function needs to be caught and shot. It's one of the quirkiest and odd functions that PHP has and requires some knowledge of how SMTP and often MIME work to call. If you do want to figure out how to use, put it behind an API call once you have.