我们介绍了symfony的swiftmailer的第三方bundle的配置。
但是symfony在中国比较少人用,我们现在就直接用php配置一下邮件发送吧!
不喜欢废话,直接上代码:
第一步:下载包,composer可以,直接github上下载也可以
地址:https://github.com/swiftmailer/swiftmailer
第二步:在使用的地方加入包入口文件
require_once "./../swiftmailer/lib/swift_required.php";
第三步:直接new对象就可以了
就这样简单!我们动起来吧!
原文:https://www.cnblogs.com/zhoushengming/p/13936986.html