最佳 PHP 邮件类

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8569418/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 05:01:13  来源:igfitidea点击:

Best PHP Mail class

phpoopclassemail

提问by salonMonsters

I've been using php's mail function for years and decided it was finally time to make my code a bit more Object Oriented rather than writing out the code each time.

我多年来一直在使用 php 的邮件功能,并决定是时候让我的代码更加面向对象了,而不是每次都写出代码。

I was going to build my own mailer class but I figure there must be a ton of great classes out there already. I started looking and got a bit overwhelmed by the choice so I thought it was a good question to put to SO

我打算建立自己的邮件程序类,但我认为那里已经有很多很棒的类了。我开始寻找,但对这个选择有点不知所措,所以我认为这是一个很好的问题

Can anyone recommend their favourite/best php mail class?

谁能推荐他们最喜欢/最好的 php 邮件类?

I'm just using it to send plain text email right now but will be shortly switching to html formatted emails so something that can grow with me would be best.

我现在只是用它来发送纯文本电子邮件,但很快就会切换到 html 格式的电子邮件,所以最好能和我一起成长的东西。

Thanks

谢谢

回答by Abhi Beckert

We have been using PHPMailer for nearly a decade with no problems:

我们已经使用 PHPMailer 近十年没有出现任何问题:

https://github.com/Synchro/PHPMailer

https://github.com/Synchro/PHPMailer

It has some nice features, such as good email validation (a harder problem to solve than it seems), and converting your HTML to human-readable plain text, with very nice ascii formatting for headers, tables, etc.

它有一些不错的功能,例如良好的电子邮件验证(比看起来更难解决的问题),以及将您的 HTML 转换为人类可读的纯文本,以及非常好的标题、表格等的 ascii 格式。