我的电子邮件被发送到垃圾邮件,但没有发送到代码点火器的收件箱

时间:2017-09-19 05:58:22

标签: php codeigniter email

此代码工作正常,但邮件将转到垃圾邮件文件夹而不是收件箱。

public function get_in_touch_always(){

$this->_Creating_get_in_touch_always();
    if ($this->form_validation->run() === TRUE){
        $data = array();
        $data['name'] = $_POST['name'];
        $data['email'] = $_POST['email'];
        $data['phone'] = $_POST['mobile'];
        $data['message'] = $_POST['message'];
        //$data['charges'] = $_POST['charges'];
        $data['upload_date'] = date("d M Y");
        $data['upload_time'] =  date("h:i a");    
    if ($this->b->insert_in_touch_always($data)) {
    $this->load->library('email');
    $config['protocol']='smtp';
    $config['smtp_host']='xxx.com';
    $config['smtp_port']='465';
    $config['smtp_timeout']='60';
    $config['smtp_user']='xxx@yy.com';
    $config['smtp_pass']='xxx';
    $config['charset']='utf-8';
    $config['newline']="\r\n";
    $config['crlf']="\r\n";
    $config['wordwrap'] = TRUE;
    $config['mailtype'] = 'html';
    $this->email->initialize('email',$config);
    $this->email->from('xxx@yy.com', 'xxx');
    $this->email->to('yyyy');
    $this->email->bcc('zzz@gmail.com');       
    $this->email->subject('Notification Mail');
    $this->email->message('Hie world');
    if($this->email->send()){
        echo "Sent";
    }else{
        echo "fail";
    }
    die();
    echo "ok sent";
    show_error($this->email->print_debugger());                   
            $this->outputData['error'] = 'Successfully Your Query is Created';
        } else {
            $this->outputData['error'] = 'Failed To Insert';
        }
    } else {
        $this->outputData['error'] = validation_errors();
    }
    $this->load->view('thanku', $this->outputData);
}
}

请让我知道解决方案。我收到邮件但它仍然是垃圾邮件文件夹。有什么要补充的吗?

0 个答案:

没有答案