codeigniter电子邮件发送到垃圾邮件

时间:2012-05-21 09:03:24

标签: php email codeigniter spam

我的模特:

<?php
class email_model extends CI_Model {

    function __construct()
    {
        // Call the Model constructor
        parent::__construct();
    }

        public function sendEmail($from = null, $to = null, $subject = null, $message = null){

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

            $config['protocol'] = 'sendmail';
            $config['mailpath'] = '/usr/sbin/sendmail';
            $config['charset'] = 'utf-8';
            $config['mailtype'] = 'html';
            $config['wordwrap'] = TRUE;

            $this->email->initialize($config);

            $this->email->from('email@mydomain.com', 'Website name');

            $this->email->to($to);

            $this->email->subject($subject);

            $this->email->message($message);

            $this->email->send();

        }
}

我的域名托管在GoDaddy上,我也在那里创建了一封电子邮件并将其重定向到我的Gmail邮箱...

为什么我的电子邮件会发送到垃圾邮件文件夹而不是收件箱?

编辑:我的电子邮件内容基本上是欢迎邀请

Hello $email

$website has invited you to join the website

to join visit the following link

$link_goes_here

Thanks, the team

2 个答案:

答案 0 :(得分:-1)

如果您使用HTML来显示邮件,则必须确保使用有效的html发送邮件。 您可以在此处验证您的邮件:http://validator.w3.org/

答案 1 :(得分:-1)

如果是,请联系我们表格.. 也许你可以尝试通过亚马逊SES发送电子邮件,所以google / yahoo并不认为它是垃圾邮件