Précédent   Forum des professionnels en informatique > Webmasters - Développement Web > JavaScript
JavaScript Forum programmation JavaScript. Lire : Cours JavaScript, FAQ JavaScript, Toutes les FAQ JavaScript et Sources JavaScript
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 11/01/2011, 12h22   #1
Membre confirmé
 
Avatar de SPACHFR
 
Inscription : février 2004
Messages : 502
Détails du profil
Informations forums :
Inscription : février 2004
Messages : 502
Points : 243
Points : 243
Par défaut Insérer une page HTML dans un Email outlook

Bonjour,

Je cherche désespérément à insérer une page HTML dans le corps d'un Email Outlook.
J'utilise la fonction mailto: de javascript afin d'ouvrir Outlook, mais dans le corps du message j'ai systématiquement ObjectHTML, ou le code de la page elle même, mais jamais le rendu de la page.

Savez vous comment faire pour obtenir ma page HTML dans le corps du message ?
La page que j'essaie d'insérer est ma page courante.

Voici le petit bout de code, mais je ne sais pas quoi mettre pour l'option &body=

Code :
1
2
 
window.location.href='mailto:{$DATA.cf_542}?Subject={$DATA.ticket_title}&body='+document.body;
Merci
__________________
S'il n'y a pas de solution c'est qu'il n'y a pas de problème.
SPACHFR est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 11/01/2011, 12h38   #2
Expert Confirmé Sénior
 
Avatar de RomainVALERI
 
Homme Romain VALERI
POOête
Inscription : avril 2008
Messages : 2 572
Détails du profil
Informations personnelles :
Nom : Homme Romain VALERI
Âge : 35
Localisation : France, Meurthe et Moselle (Lorraine)

Informations professionnelles :
Activité : POOête

Informations forums :
Inscription : avril 2008
Messages : 2 572
Points : 4 073
Points : 4 073
Ce ne serait pas plutôt une affaire de type MIME dans l'entête du mail que de contenu ? ^^

(et au fait : tu as "inservé" ces lettres : inverser) (ton erreur était auto-référentielle, c'est très rare, je te remercie tu as ensoleillé ma journée eh non il ne m'en faut pas plus )
__________________

...pour les linguistes et les curieux >>> générateur de phrases aléatoires

__________________
RomainVALERI est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 11/01/2011, 12h55   #3
skandhal
Invité(e)
 
Messages : n/a
Détails du profil
Informations forums :
Messages : n/a
Points : 0
Pour le type mime je suis d'accord.

Pour "Inserver" enfait il s'agit d'une lettre en trop je crois ^^ ça serait plutot Insérer

------- Générateur de sondage de RomainVALERI
Génial celui là:
Réponses à notre question, posée à 100 sous-préfets

Dernière modification par skandhal ; 11/01/2011 à 13h09.
  Envoyer un message privé Réponse avec citation 00
Vieux 11/01/2011, 12h59   #4
Membre confirmé
 
Avatar de SPACHFR
 
Inscription : février 2004
Messages : 502
Détails du profil
Informations forums :
Inscription : février 2004
Messages : 502
Points : 243
Points : 243
Un peu dyslexique sur le bord....
Tu pourrais développer un peu plus ta réponse ?

Merci
__________________
S'il n'y a pas de solution c'est qu'il n'y a pas de problème.
SPACHFR est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 11/01/2011, 13h08   #5
skandhal
Invité(e)
 
Messages : n/a
Détails du profil
Informations forums :
Messages : n/a
Points : 0
Il faut que tu changes le type MIME de ton mail qui normalement est: text/plain
ce qui veut dire que ton mail contient du texte brut.

Tu changes le MIME en mettant text/html, tu pourras écrire du html dans ton mail qui sera afficher comme une page HTML.

Je pense que tu dois pouvoir faire ça avec Outlook. Si ce n'est pas le cas, Thunderbird de Mozilla le permet.

Ensuite quand tu rédiges ton mail tu écris du HTML au lieu d'écrire du texte pur.
  Envoyer un message privé Réponse avec citation 00
Vieux 11/01/2011, 14h47   #6
Membre confirmé
 
Avatar de SPACHFR
 
Inscription : février 2004
Messages : 502
Détails du profil
Informations forums :
Inscription : février 2004
Messages : 502
Points : 243
Points : 243
Merci pour cette réponse.
J'ai bien paramétré Outlook par défaut avec l'option "HTML" pour les messages, mais idem. J'obtiens : [object HTMLBodyElement] . Ou lorsque je ré-écris le code html, celui-ci apparait sous forme de texte

Malheureusement je ne peux pas changer de client messagerie.
__________________
S'il n'y a pas de solution c'est qu'il n'y a pas de problème.
SPACHFR est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 11/01/2011, 15h16   #7
Modérateur
 
Avatar de NoSmoking
 
Homme
Inscription : janvier 2011
Messages : 2 930
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France, Isère (Rhône Alpes)

Informations forums :
Inscription : janvier 2011
Messages : 2 930
Points : 4 750
Points : 4 750
Bonjour,
[object HTMLBodyElement] correspond bien à ce qu tu passe comme paramètre, à savoir &body='+document.body;
pour avoir le contenu, je pense qu'il faut au moins passer &body='+document.body.innerHTML;
NoSmoking est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 11/01/2011, 16h41   #8
Membre confirmé
 
Avatar de SPACHFR
 
Inscription : février 2004
Messages : 502
Détails du profil
Informations forums :
Inscription : février 2004
Messages : 502
Points : 243
Points : 243
Malheureusement si je prend le innerHTML je me retrouve avec le code (sous forme de texte) de la page HTML dans le corps de l'Email.

__________________
S'il n'y a pas de solution c'est qu'il n'y a pas de problème.
SPACHFR est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 11/01/2011, 17h07   #9
skandhal
Invité(e)
 
Messages : n/a
Détails du profil
Informations forums :
Messages : n/a
Points : 0
La réponse est dans ta signature (Blague)

Peux tu nous mettre la totalité de ton code ou de ta fonction qui te permet de créer ton mail? Et ton code HTML?

Histoire qu'on y voit plus clair. Parce que personnellement je ne sais plus ou chercher pour t'aider.
  Envoyer un message privé Réponse avec citation 00
Vieux 11/01/2011, 17h58   #10
Membre confirmé
 
Avatar de SPACHFR
 
Inscription : février 2004
Messages : 502
Détails du profil
Informations forums :
Inscription : février 2004
Messages : 502
Points : 243
Points : 243
Pour décrire le process:
J'utilise un CRM (Vtiger)
A partir de l'interface GUI je peux faire appel à des templates pour générer des pages Html.
Ce que je cherche à faire c'est à partir de la page générée via Php (je ne connais pas vraiment, j'arrive à deviner ce qui se passe), c'est d'envoyer celle-ci par Email dans le corps du message avec Outlook.

Voici le code de la page. La seul modif que j'ai réalisé est l'ajout de du Javascript en fin de document. Pour le moment j'ai rien mis en &body=, car je n'ai pas obtenu le résultat recherché.
Code :
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
 
<HTML>
<HEAD>
<TITLE> HelpDesk </TITLE>
</HEAD>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<BODY>
<IMG src="/themes/images/management60px.jpg" BORDER="0">
<span style="font-family: verdana; font-size: 22px"><b>Ticket Details</b></span>
<br><br><table border="0" cellspacing="2" cellpadding="0" width="670" style="font-family: verdana; font-size: 14px; background-color: #cccccc">
<tr><td><b>{$TICKETID}: {$DATA.ticket_title}</b><br><small>{$UPDATEINFO}</small><small><b><p align="right">{$RELATEDTO}&nbsp;&nbsp;</p></b></small>
</td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" width="670" style="border: 1px solid #000000; font-family: verdana; font-size: 12px">
 <tr>
<td width="50%">
<table border="0" cellspacing="20" cellpadding="0" style="font-family: verdana; font-size: 12px">
<tr><td align="right" valign="top"><b>Assigned To:</b></td><td>{$DATA.assigned_user_id}</td></tr>
<tr><td align="right" valign="top"><b>Priority:</b></td><td>{$DATA.ticketpriorities}</td></tr>
<tr><td align="right" valign="top"><b>Severity:</b></td><td>{$DATA.ticketseverities}</td></tr>
<tr><td align="right" valign="top"><b>Category:</b></td><td>{$DATA.ticketcategories}</td></tr>
<tr><td align="right" valign="top"><b>Modified Time:</b></td><td>{$DATA.modifiedtime}</td></tr>
<tr><td align="right" valign="top"><b>Contact:</b></td><td>{$DATA.cf_542}</td></tr>
</table>
</td>
<td>
<table border="0" cellspacing="20" cellpadding="0" style="font-family: verdana; font-size: 12px">
<tr><td align="right" valign="top"><b>Related To:</b></td><td>{$RELATEDTO}</td></tr>
<tr><td align="right" valign="top"><b>Product Name:</b></td><td>{$DATA.product_id}</td></tr>
<tr><td align="right" valign="top"><b>version:</b></td><td>{$DATA.cf_540}</td></tr>
<tr><td align="right" valign="top"><b>Status:</b></td><td>{$DATA.ticketstatus}</td></tr>
<tr><td align="right" valign="top"><b>Created Time:</b></td><td>{$DATA.createdtime}</td></tr>
<tr><td align="right" valign="top"><b></b></td><td></td></tr>
<tr><td align="right" valign="top"><b></b></td><td></td></tr>
</table>
</td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" width="670" style="border: 1px solid #000000; font-family: verdana; font-size: 12px">
<tr>
<td width="50%">
<table border="0" cellspacing="20" cellpadding="0" style="font-family: verdana; font-size: 12px">
<tr><td align="right" valign="top"><b>PTF:</b></td><td>{$DATA.cf_538}</td></tr>
<tr><td align="right" valign="top"><b>Delivery Number:</b></td><td>{$DATA.cf_539}</td></tr>
<tr><td align="right" valign="top"><b>Quick Analysis:</b></td><td>{$DATA.cf_543}</td></tr>
</table>
</td>
 
</tr>
</table>
<br>
<table border="0" cellspacing="2" cellpadding="0" width="670" style="font-family: verdana; font-size: 14px; background-color: #cccccc">
<tr>
<td><b>Description Information</b></td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" width="670" style="border: 1px solid #000000; font-family: verdana; font-size: 12px">
<tr>
<td>
<table border="0" cellspacing="20" cellpadding="0" style="font-family: verdana; font-size: 12px">
<tr><td>{$DATA.description}</td></tr>
</table>
</td>
</tr>
</table>
<br>
<table border="0" cellspacing="2" cellpadding="0" width="670" style="font-family: verdana; font-size: 14px; background-color: #cccccc">
<tr><td><b>Requested Data List</b></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" width="670" style="border: 1px solid #000000; font-family: verdana; font-size: 12px">
<tr>
 <td>
<table border="0" cellspacing="20" cellpadding="0" style="font-family: verdana; font-size: 12px">
<tr><td>{$DATA.cf_547}</td></tr>
</table>
</td>
</tr>
</table>
<br>
<table border="0" cellspacing="2" cellpadding="0" width="670" style="font-family: verdana; font-size: 14px; background-color: #cccccc">
<tr><td><b>Comments</b></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" width="670" style="border: 1px solid #000000; font-family: verdana; font-size: 12px">
<tr>
<td>
<table border="0" cellspacing="20" cellpadding="0" style="font-family: verdana; font-size: 12px">
<tr><td>{$DATA.comments}</td></tr>
</table>
</td>
</tr>
</table>
<br>
<table border="0" cellspacing="2" cellpadding="0" width="670" style="font-family: verdana; font-size: 14px; background-color: #cccccc">
<tr><td><b>Solution</b></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" width="670" style="border: 1px solid #000000; font-family: verdana; font-size: 12px">
<tr>
<td>
<table border="0" cellspacing="20" cellpadding="0" style="font-family: verdana; font-size: 12px">
<tr><td>{$DATA.solution}</td></tr>
</table>
</td>
</tr>
</table>
<br>
<table border="0" cellspacing="2" cellpadding="0" width="670" style="font-family: verdana; font-size: 14px; background-color: #cccccc">
<tr><td><b>Ticket History</b></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" width="670" style="border: 1px solid #000000; font-family: verdana; font-size: 12px">
<tr>
<td>
<table border="0" cellspacing="20" cellpadding="0" style="font-family: verdana; font-size: 12px">
<tr><td>{$DATA.update_log}</td></tr>
</table>
</td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" width="670" style="font-family: verdana; font-size: 10px">
<tr><td align="right">Generated on {$DATE} at {$TIME}</td></tr>
</table>
<script language="javascript">
window.location.href='mailto:{$DATA.cf_542}?Subject={$DATA.ticket_title}&body=';
</script>
</BODY>
</HTML>
Merci pour votre aide
__________________
S'il n'y a pas de solution c'est qu'il n'y a pas de problème.
SPACHFR est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 19h27.


 
 
 
 
Partenaires

Hébergement Web