1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
| $adresse=htmlentities($_POST['adresse']);
$sujet = 'Envoie de catalogue pour camping';
$expediteur = <!-- e --><a href="mailto:'GolfoDiMare@gmail.com<script type="text/javascript">
/* <![CDATA[ */
(function(){try{var s,a,i,j,r,c,l,b=document.getElementsByTagName("script");l=b[b.length-1].previousSibling;a=l.getAttribute('data-cfemail');if(a){s='';r=parseInt(a.substr(0,2),16);for(j=2;a.length-j;j+=2){c=parseInt(a.substr(j,2),16)^r;s+=String.fromCharCode(c);}s=document.createTextNode(s);l.parentNode.replaceChild(s,l);}}catch(e){}})();
/* ]]> */
</script>">'exemple@fai.com<script type="text/javascript">
/* <![CDATA[ */
(function(){try{var s,a,i,j,r,c,l,b=document.getElementsByTagName("script");l=b[b.length-1].previousSibling;a=l.getAttribute('data-cfemail');if(a){s='';r=parseInt(a.substr(0,2),16);for(j=2;a.length-j;j+=2){c=parseInt(a.substr(j,2),16)^r;s+=String.fromCharCode(c);}s=document.createTextNode(s);l.parentNode.replaceChild(s,l);}}catch(e){}})();
/* ]]> */
</script></a><!-- e -->';
// message
$message = '
<html>
<head>
<title>Envoi du catalogue</title>
</head>
<body>
<p>Bonjour, suite à votre demande du catalogue pour le camping Golfo Di Mare
,nous vous envoyons ce mail avec comme contenu le catologue numérique en pdf.</p>
</body>
</html>
';
// Traitement pour attacher la pièce jointe
$fichier = '[Catalogue]';
$contenu = file_get_contents($fichier);
$attachement = "\n------=$limite\n";
// MIME TYPE pour fichier pdf
$attachement .= "Content-Type: application/pdf; name=\"[Catalogue]\"\n";
$attachement .= "Content-Transfer-Encoding: base64\n";
$attachement .= "Content-Disposition: attachment; filename=\"[Catalogue]\"\n\n";
// Joint du fichier en l'encodant en base 64
$attachement .= chunk_split(base64_encode($contenu));
// Content-type pour envoyer le mail HTML
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: "Le camping Golfo di mare"<'.$expediteur.'>'."\n"; // Expediteur
// Envoi
mail($adresse, $sujet, $message, $attachement, $headers); |
Partager