codeigniter以垃圾邮件发送邮件

时间:2017-11-13 10:26:14

标签: php codeigniter email co

我使用以下代码发送邮件

但发送的邮件是垃圾邮件。如何将其标记为不以编程方式发送垃圾邮件

$this->load->library('email');

 if($this->config->item('protocol')=="smtp"){
            $config['protocol'] = 'smtp';
            $config['smtp_host'] = $this->config->item('smtp_hostname');
            $config['smtp_user'] = $this->config->item('smtp_username');
            $config['smtp_pass'] = $this->config->item('smtp_password');
            $config['smtp_port'] = $this->config->item('smtp_port');
            $config['smtp_timeout'] = $this->config->item('smtp_timeout');
            $config['mailtype'] = $this->config->item('smtp_mailtype');
            $config['starttls']  = $this->config->item('starttls');
             $config['newline']  = $this->config->item('newline');

            $this->email->initialize($config);
        }
            $fromemail='jodbaki@gmail.com';
            $fromname='Jod Baki';
            $subject=$this->config->item('activation_subject');
            $message=$this->config->item('activation_message');;

            $message=str_replace('[verilink]',$verilink,$message);

            $toemail=$this->input->post('email');

            $this->email->to($toemail);
            $this->email->from($fromemail, $fromname);
            $this->email->subject($subject);
            $this->email->message($message);
            if(!$this->email->send()){
             print_r($this->email->print_debugger());
            exit;
            }

我正在发送以下信息

Hi,
 Thank you for registering with us. Please click below link to verify your
email address.
 <a href='http://jodbaki.com/exam/?/login/verify/'>Click Here</a>
 or
     Copy below link and visit in browser
 http://jodbaki.com/exam/?/login/verify/

 Thanks

1 个答案:

答案 0 :(得分:0)

电子邮件服务负责查明您是否发送垃圾邮件。它与您的代码或codeigniter无关。

尝试在有效域下创建电子邮件,并阻止发送垃圾邮件等内容。

这篇文章旨在避免您的电子邮件像垃圾邮件一样:

Avoiding spam filters