如何在php进入垃圾邮件文件夹中停止mail()? [重复]

I am having a problem with my code when my website send register email to user, it goes into spam folder. This is the picture of email that got to spam.

enter image description hereIt also says that via gator4168.hostgator.com which what I don't want. This is the code I am using.

function register_user($register_data){
        array_walk($register_data, 'array_sanitize');
        $register_data['password'] = md5($register_data['password']);

        $fields = '`' . implode('`, `', array_keys($register_data)) . '`';
        $data = '\'' . implode('\', \'', $register_data) . '\'';
        $headers ="From:<$from>
";
        $headers.="MIME-Version: 1.0
";
        $headers.="Content-type: text/html; charset=iso 8859-1";
        mysql_query("INSERT INTO `users` ($fields) VALUES ($data)");
        email($register_data['email'], 'Camdrivers Member Activating Request', "Dear " . $register_data['first_name'] . ",

You have just registed in our website, Camdrivers.asia to be one of our publisher members. In order to join us, we need first to identify whether your contact email is correct or not. 

You need to activate your account before you can use it. Click the link below to acctivate now:

http://camdrivers.asia/activate?email=" . $register_data['email'] . "&email_code=" . $register_data['email_code'] . "

- CamDrivers

- Tel: (855)97 77 56 098 / (855)96 90 96 091

- Location: Siem Reap, Cambodia",$headers);
    }

Can you help me solve the problem to get all my email to be sent to inbox not spam?

Thanks

</div>

You can influence, but not control this. It is up to each individual person to configure how their email is sorted and therefore marked as Junk or not.

There are some things you can do however, like:

  • sending plain text email bodies
  • using a trusted SMTP server
  • enabling SPF for your domain
  • DKIM signing your emails

Explaining everything here seems superfluous, there are many many guides on the WWW helping you out with this.

My advice is to register a dummy user with an email address from Mail Tester and start from there.

Good luck!