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

报告相同问题?

悬赏问题

  • ¥15 宇视监控服务器无法登录
  • ¥15 PADS Logic 原理图
  • ¥15 PADS Logic 图标
  • ¥15 电脑和power bi环境都是英文如何将日期层次结构转换成英文
  • ¥20 气象站点数据求取中~
  • ¥15 如何获取APP内弹出的网址链接
  • ¥15 wifi 图标不见了 不知道怎么办 上不了网 变成小地球了
  • ¥50 STM32单片机传感器读取错误
  • ¥50 power BI 从Mysql服务器导入数据,但连接进去后显示表无数据
  • ¥15 (关键词-阻抗匹配,HFSS,RFID标签天线)