dongqu4443 2015-01-18 14:17
浏览 56
已采纳

在Codeigniter中发送电子邮件

I'm pretty noob in Codeigniter and PHP and is currently learning by making projects and such for school stuff. In my project, email is included. I wanted to know what are the things I should learn in emailing and where to start. What i know is I have to configure it first in codeigniter, I guess sending is easy because there are lots of sources on how to do it. What about receiving? Do i need a third party such as "gmail smpt" for me to do it? Do i need an online server? or can I do it locally? I did google about this "email" thing but there are so many ways to do it and its confusing me. Someone who can explain it to me slowly would be better and provide sources such as step by step tutorials to do email through sending and receiving. Thanks in advance!

  • 写回答

1条回答 默认 最新

  • duandoucou7200 2015-01-18 15:54
    关注

    Codeigniter has pretty good email system on it. You can learn so much by looking on user guide pretty easy to understand.

    You can find out more by reading through the user guide http://www.codeigniter.com/user_guide/

    Good tutorial how to set up email codeigniter https://www.youtube.com/watch?v=VlNz6GlSjPo

    Email Class http://www.codeigniter.com/user_guide/libraries/email.html

    $this->load->library('email');
    
    $config['protocol'] = 'sendmail';
    $config['mailpath'] = '/usr/sbin/sendmail';
    $config['charset'] = 'iso-8859-1';
    $config['wordwrap'] = TRUE;
    
    $this->email->initialize($config);
    
    $this->email->from('your@example.com', 'Your Name');
    $this->email->to('someone@example.com');
    $this->email->cc('another@another-example.com');
    $this->email->bcc('them@their-example.com');
    
    $this->email->subject('Email Test');
    $this->email->message('Testing the email class.');
    
    $this->email->send();
    
    echo $this->email->print_debugger();
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
  • ¥15 名为“Product”的列已属于此 DataTable
  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
  • ¥50 成都蓉城足球俱乐部小程序抢票
  • ¥15 yolov7训练自己的数据集
  • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)