Xou
I ♥ rien
Bonjour,
Je tente de faire un envoie de mail en HTML, cela fonctionne très bien, sauf avec gmail par exemple, et je me dis que ça risque de poser un soucis sur d'autres webmail.
Le plus étrange, c'est que sur mon client mail, tout cela fonctionne très bien.
Voici le résultat :
Et je me demandais du coup, d'où le soucis pouvait venir.
Merci d'avance pour votre aide.
Je tente de faire un envoie de mail en HTML, cela fonctionne très bien, sauf avec gmail par exemple, et je me dis que ça risque de poser un soucis sur d'autres webmail.
Le plus étrange, c'est que sur mon client mail, tout cela fonctionne très bien.
Voici le résultat :
J'ai donc à cet effet, créer une fonction toute simpleContent-type: text/html; charset=utf8
To: Patrick <to@mail.wouep.net>
From: Patrick <patrick@domaine.com>
<htmlbody
div style="font-family:verdana; font-size:10px;padding: 10px"
p>nom : Patrick<br />mail : patrick@domaine.com<br />message : test formulaire contact HTML<br />from <strong>xyo.web</strong
/p>
</div/body
/html>
PHP:
function email($name,$mail,$to,$sujet,$message)
{
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=utf8' . "\r\n";
// En-têtes additionnels
$headers .= 'To: Patrick <'.to.'>' . "\r\n";
$headers .= 'From: '.$name.' <'.$mail.'>' . "\r\n";
$doc = '<html>';
$doc .= '<body>';
$doc .= '<div style="font-family:verdana; font-size:10px;padding: 10px">';
$doc .= $message;
$doc .= '</div>';
$doc .= '</body>';
$doc .= '</html>';
mail ($to, $sujet, $doc, $headers);
}
Merci d'avance pour votre aide.