微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

php – 使用Codeigniter发送邮件

它是我的控制器

    $to = "goeboekimutcs@gmail.com";
    $subject = "Goeboek I-Mut";
    $content = "<html><body><p>Test Content</p></body></html>";
    $headers = "From: goeboekimutcs@gmail.com";
    mail($to, $subject, $content, $headers);

这是我的PHP.ini

; XAMPP: Comment out this if you want to work with fakemail for forwarding to your mailBox (sendmail.exe in the sendmail folder)
sendmail_path = "\"D:\Programs\xampp\sendmail\sendmail.exe\" -t"

; XAMPP: Comment out this if you want to work with mailTodisk, It writes all mails in the D:\Programs\xampp\mailoutput folder
; sendmail_path="D:\Programs\xampp\mailtodisk\mailtodisk.exe"

这是我的sendmain.ini

smtp_server=smtp.gmail.com

; smtp port (normally 25)

smtp_port=587
auth_username= goeboekimutcs@gmail.com
auth_password= **

我在我的浏览器上打开我的控制器,加载后,我刷新我的Gmail,但没有电子邮件来…有时它发送,但往往不发送.发生什么事?

解决方法:

最好使用一些第三方库来发送像PHPMailer这样的电子邮件,这可以为您节省很多麻烦.您需要做的就是设置一些初始配置.

您可以在此处获取最新更新以及用法

PHPMailer Github link

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐