Buenas, el problema que tengo es con un codigo para enviar mails con archivos adjuntos que encontré en la web y quiero modificarlo para enviar una variable, sin embargo al colocar la variable no me llega en el correo, ya verifique que la variable no esta vacía así que supongo que sera error mio o algo que desconozco aun.
$id=$_GET['id'];
//The form has been submitted, prep a nice thank you message
$output = '<h1>!</h1>';
//Set the form flag to no display (cheap way!)
$flags = 'style="display:none;"';
//Deal with the email
$to = 'ganadores@ats.com';
$subject = 'Subasta slip';
$message = strip_tags($_POST['message']);
$attachment =
chunk_split(base64_encode(file_get_contents($_FILES['file']['tmp_name'])));
$filename = $_FILES['file']['name'];
$boundary =md5(date('r', time()));
$headers = "From: cliente@acs.com\r\nReply-To: cliente@acs.com";
$headers .= "\r\nMIME-Version: 1.0\r\nContent-Type: multipart/mixed; boundary=\"_1_$boundary\"";
$message="This is a multi-part message in MIME format.
--_1_$boundary
Content-Type: multipart/alternative; boundary=\"_2_$boundary\"
--_2_$boundary
Content-Type: text/html; charset=\"iso-8859-1\"
Content-Transfer-Encoding: 7bit
//********************aquí es donde quiero enviar la variable****************
<h2>ID del producto</h2>
<p>".$id."</p>
$message
--_2_$boundary--
--_1_$boundary
Content-Type: application/octet-stream; name=\"$filename\"
Content-Transfer-Encoding: base64
Content-Disposition: attachment
$attachment
--_1_$boundary--";
mail($to, $subject, $message, $headers);
Como nota al margen, me sirve cualquier forma de enviar la variable, solo necesito que se vea en alguna parte. Gracias de antemano
<p>\"$id\"</p>
<p>$id</p>