Email Duplication Using PHP Mail ()

0

I need help, I do not know where the error is to generate mail duplicity for only $ to. Here is my code below:

$mails = '[email protected]';
$Nome = 'Fulano';
$Email = '[email protected]';

        $to      = '[email protected]';
        $subject = 'teste';
        // To send HTML mail, the Content-type header must be set
        $headers  = 'MIME-Version: 1.1' . "\r\n";
        $headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
        $message = 'mensagem minha mensagem';

        $headers .= 'From: '.$Nome.'<'.$Email.'>'. "\r\n";
        if ($mails != ''){
            $headers .= 'Cc: '.$mails.''. "\r\n";
        }
        $headers .= 'X-Mailer: PHP'."\r\n"; //mailer
        $headers .= 'X-Priority: 3'."\r\n"; //1 UrgentMessage, 3 Normal
        /*$headers .= 'Return-Path: '.$Email.''."\r\n"*/;
        $headers .= 'Reply-to: '.$Email.''."\r\n";
        mail($to, $subject, $message, $headers);

        echo "true";
        exit(); // coloquei pra ver se matava algum loop, mais não deu certo porque não tem loop nenhum.

obs: I put fake emails

    
asked by anonymous 10.05.2017 / 14:03

0 answers