首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用Codeigniter发送邮件

使用Codeigniter发送邮件
EN

Stack Overflow用户
提问于 2015-05-21 12:02:12
回答 1查看 341关注 0票数 4

这是我的控制器

代码语言:javascript
复制
    $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

代码语言:javascript
复制
; 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

代码语言:javascript
复制
smtp_server=smtp.gmail.com

; smtp port (normally 25)

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

我在浏览器上打开我的控制器,加载后,我刷新了我的gmail,但没有收到电子邮件。有时它会发送,但通常不发送。发生了什么?

EN

回答 1

Stack Overflow用户

发布于 2015-05-28 19:52:23

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

你可以在这里获得最新的更新和用法:

PHPMailer Github link

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30364353

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档