Skip to content

Instantly share code, notes, and snippets.

@xtornasol512
Created July 2, 2014 19:34
Show Gist options
  • Save xtornasol512/93b0f2439fe9f5aae904 to your computer and use it in GitHub Desktop.
Save xtornasol512/93b0f2439fe9f5aae904 to your computer and use it in GitHub Desktop.
Archivo PHP para enviar Emails en Bluehost
<?php
/*
* A Design by PhyroServer
Author: PhyroServer
Author URL: http://phyroserver.com
License: Creative Commons Attribution 3.0 Unported
License URL: http://creativecommons.org/licenses/by/3.0/
*
*/
$userName=$_REQUEST['userName'];
$userEmail=$_REQUEST['userEmail'];
$userPhone=$_REQUEST['userPhone'];
$userMsg=$_REQUEST['userMsg'];
$subject = "Message from ".$userName;
$message = '<html><head><title>'.$subject.'</title></head><body><table><tr><td>Email id : </td><td> '.$userEmail.'</td></tr>
<tr><td>No. de Telefono : </td><td> '.$userPhone.'</td></tr><tr><td>Nombre : </td><td> '.$userName.'</td></tr><tr><td>Dice : </td><td> '.$userMsg.'</td>
</tr></table></body></html>';
//$message = "Email id : ".$userEmail. "\r\nPhone No : ".$userPhone."\r\nName : ".$userName."\r\nSays : ".$userMsg;
$to=$email_id;
$headers = "From: " . strip_tags($userEmail) . "\r\n";
$headers .= "Reply-To: ". strip_tags($userEmail) . "\r\n";
//$headers .= "CC: susan@example.com\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
if(!mail($to, $subject, $message, $headers)){
$mail_status='no';
header("Location: index.html");
exit();
}else{
$mail_status='yes';
header("Location: index.html");
exit();
} ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment