Send mail mail () function using UOL Host

0

I have the following class for sending emails

  class EmailEnviarDao {

    public function __construct() {}

    public function enviaEmail($email)  {

      $cabecalhos  = 'MIME-Version: 1.0' . "\r\n";
      $cabecalhos .= 'Content-type: text/html; charset=utf-8' . "\r\n";
      $cabecalhos .= 'To: '.$email->getNomeAlvo().' <'.$email->getEmailAlvo().'>' . "\r\n";
      $cabecalhos .= 'From: '.$email->getNomeRemete().' <'.$email->getEmailRemete().'>' . "\r\n";

       print "<pre>";
       //print_r($email)."<br><br><br><br>";
       print $email->getEmailAlvo()."<br>";
       print $email->getAssunto()."<br>";
       print $email->getMensagem()."<br>";
       print $cabecalhos;
       print "</pre>";  

      if(@mail($email->getEmailAlvo(), $email->getAssunto(), $email->getMensagem(), $cabecalhos)) {

         return array('success'=>'1','errors'=>'0K');

      } else {

          return array('success'=>'0','errors'=>"Não conseguimos enviar o e-mail");

      }    

    }   

  }

$email , is a objeto that has already been tested in OK .

prints within the class print

[email protected]
Re: Quero Comprar
Email enviado pelo site da Hotplate Prensas


Nome: Eu

Telefone: 3333333333

E-mail: [email protected]

Intersse: Quero Comprar

Descrição:
teste 1

MIME-Version: 1.0
Content-type: text/html; charset=utf-8
To: Hotplate Prensas 
From: Eu 

I use UOL Host hosting and email will not work at all.

Any guidance?

    
asked by anonymous 05.11.2016 / 17:17

0 answers