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();
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算