| Server IP : 159.223.102.202 / Your IP : 216.73.216.193 Web Server : nginx/1.26.0 System : Linux Gen1-cloudpanel2ubuntu2404-1vcpu-1gb-nyc1-01 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64 User : albasshbotta ( 1021) PHP Version : 8.2.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /home/bottaingenieriaUep/htdocs/www.bottaingenieria.com.ar/clases/ |
Upload File : |
<?php
//incluir clase
require_once('class.phpmailer.php');
//$owner_email = $_POST["owner_email"];
$owner_email = "info@pigmentosgama.com.ar";
//$headers = 'From:' . $_POST["email"];
$subject = 'Contacto: (desde WEB) ' . $_POST["name"];
$messageBody = "<body>";
$messageBody .= '<p>Nombre: ' . $_POST["name"] . '</p>' . "\n";
$messageBody .= '<br>' . "\n";
$messageBody .= '<p>Empresa: ' . $_POST["empresa"] . '</p>' . "\n";
$messageBody .= '<br>' . "\n";
$messageBody .= '<p>Email: ' . $_POST['email'] . '</p>' . "\n";
$messageBody .= '<br>' . "\n";
$messageBody .= '<p>Telefono: ' . $_POST['phone'] . '</p>' . "\n";
$messageBody .= '<br>' . "\n";
$messageBody .= '<p>Mensaje: ' . $_POST['message'] . '</p>' . "\n";
$messageBody .= "</body>";
if($_POST["stripHTML"] == 'true'){
$messageBody = strip_tags($messageBody);
}
try{
//crear objeto mail
$mail = new PHPMailer(); // defaults to using php "mail()"
//$body = "<body><h1>Miren que lindo que salio el email</h1></body>";
//fijar destinatario/s
$mail->AddAddress($owner_email , "Pigmentos Gama");
//fijar a quien responder
$mail->AddReplyTo($_POST['email'],$_POST["name"]);
//fijar quien lo mando! esto esta especial para pescar despistados
$mail->SetFrom($_POST['email'], 'Contacto');
//fijar Copia Carbon Oculta - esto no me anduvo
//$mail->AddBCC('contacto@rosmusica.com.ar', 'Contacto');
//Asunto
$mail->Subject = $subject;
//cuerpo alternativo si el cliente de email no soporta html
$mail->AltBody = "Para ver el mensaje, por favor utiliza un cliente con soporte HTML!";
$mail->MsgHTML($messageBody);
// if(!mail($owner_email, $subject, $messageBody, $headers)){
if(!$mail->Send()){
throw new Exception('correo electrónico no enviado');
}else{
echo 'correo electrónico enviado';
}
}catch(Exception $e){
echo $e->getMessage() ."\n";
}
?>