Bonjour,
J'ai encore un petit problème en php :P !!
J'aurais besoin d'aide pour ce script qui me permet d'envoyer des pièces jointes par email (Mais des mails en HTML)
Voici l'erreur : Parse error: syntax error, unexpected $end in /home/commint/public_html/admin/envoyer_doc_a.php on line 64
Voici mon code ! Merci de votre aide !!
<?php
// Setting a timezone, mail() uses this.
// recipients
$email = $_POST['email'];
$file = $_POST['file'];
$motifmail = $_POST['motif'];
$attachment = file_get_contents("/home/commint/public_html/dl/$file");
$HTML = "<img src='http://comm-inter-tel.ca/img/logo.jpg'></img><center><br><font face='Century Gothic' size='5'>Lien de téléchargement</font><font face='Century Gothic'><center><br>$motifmail<br><a href='http://comm-inter-tel.ca/download.php?$cdname' target='_blank'>http://comm-inter-tel.ca/download.php?$cdname</a></font>";
$from = "info@comm-inter-tel.com";
$to = $email;
$subject = "Inter-Tel.ca - Lien de téléchargement";
sendHTMLemail($HTML,$from,$to,$subject);
function sendHTMLemail($HTML,$from,$to,$subject)
{
// First we have to build our email headers
// Set out "from" address
$headers = "From: $from\r\n";
// Now we specify our MIME version
$headers .= "MIME-Version: 1.0\r\n";
// Create a boundary so we know where to look for
// the start of the data
$boundary = uniqid("HTMLEMAIL");
// First we be nice and send a non-html version of our email
$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)));
// Now we attach the HTML version
$headers .= "--$boundary\r\n".
"Content-Type: text/html; charset=ISO-8859-1\r\n".
"Content-Transfer-Encoding: base64\r\n\r\n";
$headers .= "Content-Type: application/octet-stream; name=$file".
"Content-Transfer-Encoding: base64\r\n\r\n".
"Content-Disposition: attachment";
$headers .= chunk_split(base64_encode($HTML));
?>
