I want to send an email but here is the thing, if the person selects the button 1 then it will send the email but if they select 2 it won't send the email but do something else.
Here is the code:
Here is the code:
PHP Code:
<?php
if($vote<>"2"){
?>
<?php
$HTML = "You have selected 1 as your vote! here is the code: 4837583";
$from = no-reply@domain.com;
$to = "$emailer";
$subject = "Tester";
sendHTMLemail($HTML,$from,$to,$subject);
function sendHTMLemail($HTML,$from,$to,$subject)
{
$headers = "From: $from\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$boundary = uniqid("HTMLEMAIL");
$headers .= "Content-Type: multipart/alternative;".
"boundary = $boundary\r\n\r\n";
$headers .= "This is a MIME encoded message.\r\n\r\n";
$headers .= "--$boundary\r\n".
"Content-Type: text/plain; charset=ISO-8859-1\r\n".
"Content-Transfer-Encoding: base64\r\n\r\n";
$headers .= chunk_split(base64_encode(strip_tags($HTML)));
$headers .= "--$boundary\r\n".
"Content-Type: text/html; charset=ISO-8859-1\r\n".
"Content-Transfer-Encoding: base64\r\n\r\n";
$headers .= chunk_split(base64_encode($HTML));
mail($to,$subject,"",$headers);
}
?>
<?php
}
else
{
echo "";
}
?>
Comment