我应该使用 PHPMailer 还是 SwiftMailer?
可能的重复:
PhpMailer 与 Swiftmailer?
我一直使用 PHP 内置的 mail()
功能,它一直对我有用,并且完成了我想要的工作。
现在有些人可能会想“为什么要修复没有损坏的东西?”。
如果有人问我,我的回答是:
我以前从未使用过框架,如果它们被归类为框架,或者它们可能被称为我不知道的库。
我想开始使用一个,并查看了文档,两者似乎都非常易于使用。
当我在网站中实现新功能时,我的网站更多地依赖于发送电子邮件等,这意味着 PHP 的 mail() 函数不再能胜任工作。
在处理附件、html 和文本版本等高级内容时,它们会更容易使用;否则使用 PHP 的
mail()
函数会很困难或不可能。我从未使用过 SMTP,但我研究过它,发现我可以在我的托管包上将它与 SSL 一起使用。经过大量阅读后,似乎 SMTP 不仅更可靠、使用更广泛,电子邮件也不太可能被标记为垃圾邮件,使用任何一个框架都将提高性能、可靠性和更安全,因为它使用带有 SSL 的 SMTP。
现在我不确定使用 SMTP 的其他好处是什么,也许有人可以给我更多理由为什么它更好?我希望了解有关 SMTP 优势的更多信息。
我查看了这两个文档,了解了它们都提供的功能,在 google 上搜索了 PHPMailer 与 SwiftMailer,但没有找到任何说明为什么一个比另一个更好的内容。
有人对其中任何一个有经验吗?
一个比另一个有更多的好处吗?
你会说一个比另一个更好吗?
我确实读到很多人说 PHPMailer 是一个死项目,但这些帖子相对较旧。查看 PHPMailer 的网站,该项目似乎已经重新开发了一段时间。
感谢您在 PHPMailer 和/或 SwiftMailer 上提供的任何信息。希望我可以决定其中之一,因为目前我没有理由选择其中之一。
Possible Duplicate:
PhpMailer vs. Swiftmailer?
I have always used PHP's built in mail()
function and it has always worked for me without fail and does the job I want it to.
Now some maybe thinking 'Why fix something that isn't broke ?'.
My answer to these in case someone asks is:
I have never used a framework before if that's what they are classified as or perhaps they are called a library I don't know.
I want to start using one and have looked over the documentation and both seem very easy to use.
As I implement new features into my site, my site is depending more on sending emails etc meaning PHP's mail() function is not up to the job any more.
They would be easier to use when dealing with advanced things like attachments, html and text versions etc; that would otherwise be difficult or impossible using PHP's
mail()
function.I have never used SMTP, and I have looked into it and I can see I can use it along with SSL on my hosting package. After plenty of reading it seems that not only is SMTP more reliable and more widely used, emails are less likely to be marked as spam, using either of the frameworks will improve performance, reliability and more secure because it uses SMTP with SSL.
Now I am not sure what the other benefits are using SMTP, maybe someone could give me some more reasons why it's better? I am looking to find out more information about SMTP benefits.
I have looked at both documentation looked at the features they both offer, searched google for PHPMailer vs SwiftMailer but not found anything saying why one is better than the other.
Does anyone have experience with any of them?
Does one have more benefits than the other?
Would you say one is better than the other?
I did read a lot of people saying PHPMailer was a dead project but those posts was relatively old. Looking at PHPMailer's website it seems the project is and has been back in development for some time now.
Thanks for anything you can provide on either PHPMailer and/or SwiftMailer. Hopefully I can decide on one or the other as at the moment I have no reason on why I would choose one over the other.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我唯一一次不得不偏离邮件内置功能的是当我需要从真实的“Gmail”帐户发送电子邮件时(客户在他的垃圾邮件文件夹中从我们的应用程序接收邮件)。
在本例中,我使用了 PEAR 的邮件扩展,它非常易于使用:
http://pear.php.net/包裹/邮件
The only time I had to stray from the mail built-in function was when I needed to send an email from authentic "Gmail" account (client was receiving mail from our app in his spam folder).
In this case I used PEAR's Mail Extension which was really easy to use:
http://pear.php.net/package/Mail
我说绝对是Swiftmailer。
它是用 PHP 5 编写的,基于组件; PHPMailer 是 PHP 4
它有一个更干净的网站和更好的示例
它有更好的文档
它只有一个版本在互联网上传播,而不是至少两个,就像PHPMailer一样。
I say absolutely Swiftmailer.
It is written in PHP 5 and component-based; PHPMailer is PHP 4
It has a cleaner web site with better examples
It has better documentation
It has only one version flying around the Internet and not at least two, like PHPMailer has.
我在我的项目中使用了 PHPMailer,对此没有任何抱怨。没有使用过 Swiftmailer,但两者在用法和实用性方面似乎几乎相同,仅在实现细节上有所不同。当您深入了解时,您会发现它们都是友好的界面,可向您隐藏 SMTP 电子邮件的详细信息。
选择最适合您的风格并搭配它。
I've used PHPMailer for my projects and have no complaints about it. Haven't used Swiftmailer, but both seem to be pretty much the same in terms of usage and usefulness, differing only in implementation details. When you get right down to it, they're both just friendly interfaces to hide the details of SMTP email from you.
Pick whichever one whose style suits you best and go with it.