<?

    require("class.phpmailer.php"); 
	include('main.php'); 
	header("location: tksup.html");
			
    function envio_support()
    {       
		$nome      = $_POST["nome"];	
		$email     = $_POST["email"];
		$telefone  = $_POST["telefone"];		
		$pais      = $_POST["pais"];
		$topico    = $_POST["topico"];	
		$assunto   = $_POST["assunto"];	
						        
        $msg="<html><body><br>
		Nome: ".$nome."<br><br>
		E-mail:".$email."<br><br>
		Telefone:".$telefone."<br><br>		
		Pais:".$pais."<br><br>
		Topico:".$topico."<br><br>
		Assunto:".$assunto."<br>
		</body></html>";         
            
		$mail = new PHPMailer();
		$mail->IsSMTP();                                 // send via SMTP
		$mail->Host     = "127.0.0.1";                   // SMTP servers
		$mail->SMTPAuth = true;                          // turn on SMTP authentication
		$mail->Username = "informatica@bravacar.com.pt"; // um endereo e-mail valido deste dominio
		$mail->Password = "london";                      // senha desse endereo e-mail valido deste dominio    

		$mail->From     = CUSTOMER_EMAIL;            
		$mail->FromName = "Assistencia - Bravacar";             
		$mail->AddAddress(CUSTOMER_EMAIL);          
				   
		$mail->WordWrap = 50;                            // set word wrap
		$mail->IsHTML(true);                             // send as HTML            

		$mail->Subject  =  "Assistencia ao Cliente - Site Bravacar";

		$mail->Body     =  $msg;
		$mail->AltBody  =  "";
		
		if(!$mail->Send())
		{
			echo "Mail no enviado <p>";
			echo "Erro: " . $mail->ErrorInfo;
			exit;
		}
		
		$mail->SmtpClose();

    }
	
	envio_support();

?>
