Envoi de Mail en php.
Résolu
filsdegandalf
Messages postés
8
Date d'inscription
Statut
Membre
Dernière intervention
-
filsdegandalf Messages postés 8 Date d'inscription Statut Membre Dernière intervention -
filsdegandalf Messages postés 8 Date d'inscription Statut Membre Dernière intervention -
Bonjour,
J'ai un souci sur l'envoi d'un mail au format html via la fonction mail () de php.
en effet le titre / texte s'affiche bien en revanche les variables contenu dans le code html stocké dans
$message ne s'affiche pas. ( uniquement les variables le tableau avec les titres fonctionnes ), visiblement la valeur retourné est "" mais je ne comprend pas pourquoi.
Merci par avance de votre aide.
J'ai un souci sur l'envoi d'un mail au format html via la fonction mail () de php.
en effet le titre / texte s'affiche bien en revanche les variables contenu dans le code html stocké dans
$message ne s'affiche pas. ( uniquement les variables le tableau avec les titres fonctionnes ), visiblement la valeur retourné est "" mais je ne comprend pas pourquoi.
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Envoi Mail</title> </head> <body> <?php $headers ='From: "nom"<expediteur@domaine.com>'."\r\n"; $headers .='Reply-To: expediteur@domaine.com'."\r\n"; $headers .='Content-Type: text/html; charset="iso-8859-1"'."\r\n"; $headers .='Content-Transfer-Encoding: 8bit'; $pseudo2= $_POST['pseudo']; $email=$_POST['mail']; $class=$_POST['class']; $spe=$_POST['spe']; $server=$_POST['server']; $armory=$_POST['armory']; $prenom=$_POST['prenom']; $age=$_POST['age']; $ville=$_POST['ville']; $situation=$_POST['situation']; $horaire=$_POST['horaire']; $information1=$_POST['information1']; $stuff=$_POST['stuff']; $played=$_POST['played']; $information2=$_POST['information2']; $xp=$_POST['xp']; $guild=$_POST['guild']; $wws=$_POST['wws']; $gameplay=$_POST['gameplay']; $pourquoinous=$_POST['pourquoinous']; $attente=$_POST['attente']; $apport=$_POST['apport']; $other=$_POST['other']; $url=$_POST['url']; $sujet= "apply de ".$pseudo2; $message ='<html><head><title><?php echo $sujet; ?></title></head><body><table width="804" border="0" align="left"><tr><td width="218">Pseudo:</td><td width="576"><?php echo $Pseudo2; ?></td></tr><tr><td>Classe: </td><td><?php echo $class; ?></td></tr><tr><td>Spécialisation:</td><td><?php echo $spe; ?></td></tr><tr><td>Serveur:</td><td><?php echo $server; ?></td></tr><tr><td>Lien Armory</td><td><?php echo $armory; ?></td></tr><tr><td>Prénom:</td><td><?php echo $prenom; ?></td></tr><tr><td>Age:</td><td><?php echo $age; ?></td></tr><tr><td>Ville:</td><td><?php echo $ville; ?></td></tr><tr><td>Situation :</td><td><?php echo $situation; ?></td></tr><tr><td>Horaires :</td><td><?php echo $horaire; ?></td></tr><tr><td>Précisions :</td><td><?php echo $information1; ?></td></tr><tr><td>Stuff :</td><td><?php echo $stuff; ?></td></tr><tr><td>/Played:</td><td><?php echo $played; ?></td></tr><tr> <td>Précisions :</td><td><?php echo $information2; ?></td></tr><tr><td>Expérience :</td><td><?php echo $xp; ?></td></tr><tr><td>Anciennes Guildes :</td><td><?php echo $guild; ?></td></tr><tr><td>WWS/WMO:</td><td><?php echo $wws; ?></td></tr><tr><td>Gameplay:</td><td><?php echo $gameplay; ?></td></tr><tr><td>Choix The Fall :</td><td><?php echo $pourquoinous; ?></td></tr><tr><td>Attende d une guilde PVE :</td><td><?php echo $attente; ?></td></tr><tr><td>Apport à la guilde :</td><td><?php echo $apport; ?></td></tr><tr><td>Autres :</td><td><?php echo $other; ?></td></tr><tr><td>Interface :</td><td><?php echo $url; ?></td></tr><tr><td>Email:</td><td><?php echo $email; ?></td></tr></table></body></html>'; if(mail($email, $sujet, $message, $headers)) { echo 'Le message a été envoyé'; } else { echo 'Le message n\'a pu être envoyé'; } ?> </body> </html>
Merci par avance de votre aide.
A voir également:
- Envoi de Mail en php.
- Programmer envoi mail gmail - Guide
- Publipostage mail - Accueil - Word
- Envoi mail cci - Guide
- Windows live mail - Télécharger - Mail
- Annuler envoi mail gmail - Guide