<?php
include ("sys/sys_ini.php");
$var = $_POST["curso"];
$emailform = $_POST['email'];
$nombreform = $_POST['nombre'];
$tlfform = $_POST['tlf'];
$sender = "info@----.es";
$to = "webmaster@----.es";
//$to = "comercial3.----@gmail.com";
$subject = "Solicitud ----";
$message = '
<html>
<head>
<title>SOLICITUDES</title>
</head>
<body>
<p><strong>Nombre: </strong>'.$nombreform.'<p>
<p><strong>Mail: </strong>'.$emailform.'<p>
<p><strong>Tlf: </strong>'.$tlfform.'<p>
<p><strong>Curso: </strong>'.$var.'<p>
</table>
</body>
</html>
';
$headers = "From: $sender\r\n";
$headers .= "Content-Type: text/html; charset=UTF-8\r\n";
$headers .= 'Cc: comercial1.----c@gmail.com' . "\r\n";
$headers .= 'Cc: webmaster@----.es' . "\r\n";
$headers .= "Content-type: text/html\r\n";
mail($to, $subject, $message, $headers);
header('Location: gracias.html');
//FileMaker_PHP_SmarCo_2017
$layout_name = 'Formulario_Web';
$script_name = 'CorreoFormulario';
$script_param = $nombreform ."∞". $emailform ."∞". $tlfform ."∞". $var;
$script_object = & $fm->newPerformScriptCommand($layout_name, $script_name,$script_param);
$script_result = $script_object->execute();
exit();
?>