IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Langage PHP Discussion :

[Mail] code HTML dans mail()


Sujet :

Langage PHP

  1. #1
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Juin 2005
    Messages
    56
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Juin 2005
    Messages : 56
    Points : 38
    Points
    38
    Par défaut [Mail] code HTML dans mail()
    Tout d'abord bonjour,

    Je sais qu'il y'a déjà beaucoup de topics sur la fonction mail() mais je n'ai pas trouver mon bonheur.

    J'ai essayé d'envoyer mon mail via 3 hébergements différents (ovh, phpnet, lycos), et le résultat est à chaque fois le même.

    Je voudrais tout simplement interprêter mon code HTML dans le mail reçu et non voir les balises <b> <i> <img> ...

    Ce n'est pas un problème d'hébergeur vu que mon frère utilise une newsletter où il sait le faire.

    Une proposition ?

  2. #2
    Invité
    Invité(e)
    Par défaut
    code?

  3. #3
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Juin 2005
    Messages
    56
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Juin 2005
    Messages : 56
    Points : 38
    Points
    38
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    <?
    include "../../config.php";
    $resultt = mysql_query("select journee from jj");	
    $journee = mysql_result($resultt, 0);	
     
    $result = mysql_query("SELECT pseudo, team, teamid, division, rating, etoile, pass from membre m, rating r where r.membre = m.id and journee = $journee and news = 0 and teamid = 192707 order by teamid");
    while($row = mysql_fetch_array($result)) 
    {
    	//$team = $htclient->getTeamDetails($row[teamid]);
    	//$email = $team['EMAIL'];
     
    	$resultt = mysql_query("SELECT avg(rating) from rating r, membre m where r.membre = m.id and division = $row[division]");
    	$ratingdiv = round(mysql_result($resultt, 0), 1);
    		$resultt = mysql_query("SELECT avg(etoile) from rating r, membre m where r.membre = m.id and division = $row[division]");
    		$etoilediv = round(mysql_result($resultt, 0), 1);
     
    $message = "
    	<body bgcolor=\"#FFFFFF\" topmargin=\"0\" leftmargin=\"0\" bottommargin=\"0\" text=\"#000000\" link=\"#3268B1\" vlink=\"#3268B1\" background=\"backgr.gif\">
    	<table width=\"600\" border=\"0\" cellspacing=\"0\" cellpadding=\"15\" bgcolor=\"#999999\" align=\"center\">
    	  <tr> 
    	    <td height=\"438\" background=\"backgr.gif\" bgcolor=\"#BDBABD\"> 
    	      <table width=\"99%\" border=\"0\" cellspacing=\"0\" cellpadding=\"10\" bgcolor=\"#FFFFFF\">
    	        <tr> 
    	          <td><table width=\"600\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
    	            <tr>
    	              <td width=\"591\" bgcolor=\"#29A2DB\" colspan=2><img src=\"haut.gif\" alt=\"wallistrix\" width=\"591\" height=\"50\"></td>
    	              </td>
    	              <td width=\"9\" align=\"right\"><img src=\"hn_022006_topright.gif\" width=\"9\" height=\"50\"></td>
    	            </tr>
    	           
    	            <tr>
    	              <td colspan=\"3\"><table width=\"600\" height=\"316\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
    	
    	                <tr>
    	                  <td background=\"milieu.gif\"><table width=\"600\" height=\"450\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" background=\"freedns_jun06_visual_fr.gif\">
    	                    <tr>
    	                      <td width=\"53%\" valign=\"top\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"5\">
    	                        <tr>
    	                          <td valign=\"top\"> </td>
    	                        </tr>
    	                      </table></td>
    	
    	                      <td width=\"47%\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"13\">
    	                        <tr>
    	                          <td>Bonjour,<br>
    	                            <br>
    								
    	                            Voici les données pour votre équipe pour cette \" . $journee . \"ème journée : <br><br>
    								<u>Rating</u> :<br>
    								$row[team] : $row[rating]<br> Division : $ratingdiv<br>
    								<u>Etoile</u> :<br>
    								$row[team] : $row[etoile]\nDivision : $etoilediv<br>							
    								Pour en savoir plus sur votre équipe : <a href=\"http://www.wallistrix.be/info.php?teamid=$row[teamid]\">http://www.wallistrix.be/info.php?teamid=$row[teamid]</a>\<br><br><br>
    								<div align=\"center><font size=\"-1\">Si vous ne désirez plus recevoir ce mail, cliquer sur ce lien : <a href=\"http://www.wallistrix.be/mail.php?delete=$row[teamid]&pass=$row[pass]\">se désinscire</a></font></div>
    								
    	                            </td>
    	                        </tr>
    	                      </table></td>
    	                    </tr>
    	                  </table></td>
    	                </tr>
    	
    	              </table></td>
    	            </tr>
    	            
    	            <tr>
    	              <td colspan=\"3\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
    	                
    	                    <tr>
    	                  <td colspan=\"3\" bgcolor=\"#F1EAC7\"><div align=\"center\"><span class=\"style76\">                    <br>
    	                  </span><span class=\"style89\">Copyright © 2005 wallistrix.be. Tous droits réservés.</span></div></td>
    	                  </tr>
    	
    	                <tr>
    	                  <td width=\"2%\" height=\"18\" align=\"left\" valign=\"bottom\" bgcolor=\"#F1EAC7\"><img src=\"freedns_jun06_lo.gif\" width=\"9\" height=\"9\" /></td>
    	                  <td width=\"96%\" bgcolor=\"#F1EAC7\">&nbsp;</td>
    	                  <td width=\"2%\" align=\"right\" valign=\"bottom\" bgcolor=\"#F1EAC7\"><img src=\"freedns_jun06_ro.gif\" width=\"9\" height=\"9\" /></td>
    	                </tr>
    	              </table></td>
    	            </tr>
    	            
    	          </table></td>
    	        </tr>
    	
    	      </table>
    	    </td>
    	  </tr>
    	</table>";
    }
    mail("kriekbellevue@xxx.xx", "Info wallistrix.be", $message, "FROM: kriekbellevue@xxx.xx");

  4. #4
    Membre expérimenté
    Avatar de Anduriel
    Homme Profil pro
    Ingénieur intégration
    Inscrit en
    Février 2004
    Messages
    2 290
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur intégration

    Informations forums :
    Inscription : Février 2004
    Messages : 2 290
    Points : 1 500
    Points
    1 500
    Par défaut
    Tu oublies des header.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    $headers  = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    (Ton FROM doit être aussi placé dans $headers).

  5. #5
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Juin 2005
    Messages
    56
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Juin 2005
    Messages : 56
    Points : 38
    Points
    38
    Par défaut
    Merci bien, ça roule...

    Je suis géné du niveau de la question. Désolé.

    Mais j'ai fouillé partout toute l'aprem, et je n'i pas pensé à ça.

    Encore merci.

  6. #6
    Membre expérimenté
    Avatar de Anduriel
    Homme Profil pro
    Ingénieur intégration
    Inscrit en
    Février 2004
    Messages
    2 290
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur intégration

    Informations forums :
    Inscription : Février 2004
    Messages : 2 290
    Points : 1 500
    Points
    1 500
    Par défaut
    Pas de problème mais il y avait un exemple brut dans le manel php

Discussions similaires

  1. [OL-2013] Code HTML dans les e-mails
    Par Khab' dans le forum Outlook
    Réponses: 2
    Dernier message: 11/04/2013, 09h35
  2. Windows Mail: Coller du code HTML dans le corps du mail
    Par julius26 dans le forum Outlook Express / Windows Mail
    Réponses: 1
    Dernier message: 03/12/2011, 17h16
  3. [OL-2007] Html dans mail outlook
    Par stefanelle dans le forum Outlook
    Réponses: 1
    Dernier message: 06/04/2011, 11h21
  4. affichage du code html dans le contenu de mail
    Par fraizas77 dans le forum Langage
    Réponses: 1
    Dernier message: 23/02/2011, 23h19
  5. [XL-2003] Macro pour insertion fichier html dans Mail
    Par jibdu94 dans le forum Macros et VBA Excel
    Réponses: 7
    Dernier message: 21/12/2010, 10h20

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo