【问题标题】:Having trouble testing php to send email verification in xampp在测试 php 以在 xampp 中发送电子邮件验证时遇到问题
【发布时间】:2012-11-19 06:40:08
【问题描述】:

我必须为网站编写登录、注册和受限成员功能,我一切正常,但我无法测试发送验证电子邮件,但也需要。查看它是否发送并测试电子邮件中的验证链接。

我正在运行 Acer Aspire 5920,

Ubuntu 12.04,

Xampp 1.8.1,

Codeigniter 2.1.3

【问题讨论】:

    标签: codeigniter email xampp


    【解决方案1】:

    在回答我自己的问题时,我需要传递信息来配置 xampp 以发送电子邮件:

    $config = Array(
    'protocol' => 'smtp',
    'smtp_host' => 'ssl://smtp.googlemail.com',
    'smtp_port' => 465,
    'smtp_user' => 'gmail.login@googlemail.com',
    'smtp_pass' => 'your_password',
    );
    $this->load->library('email', $config);
    $this->email->set_newline("\r\n");
    
    $this->email->from('gmail.login@googlemail.com', 'Your Name');
    $this->email->to('recipient@destination.tld');
    
    $this->email->subject(' CodeIgniter Rocks Socks ');
    $this->email->message('Hello World');
    
    
    if (!$this->email->send()){
        show_error($this->email->print_debugger());
    }else{
        echo 'Your e-mail has been sent!'; 
    }
    

    【讨论】:

      猜你喜欢
      • 2011-01-26
      • 2022-08-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-05-16
      • 1970-01-01
      • 2012-04-06
      相关资源
      最近更新 更多