Bonjour,
J'essaye de mettre en place une fonction dans mon appli web qui permet d'ouvrir une fenêtre mail déjà renseignée à l'utilisateur.
Pour cela je suis passé par une fonction que j'ai trouvé sur le web avec un ProcessStartInfo.
Le problème: en debug, ça marche nikel, par contre en éxécution normal, mon processus outlook plante, aucune fenêtre mail ne s'affiche...
D'où cela peut-il venir?
Voici mes fonctions d'envoi de mail:
Et la manière dont je l'appelle:
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 public MailTo(IData listRecipient, string sSubject, string sBody) { commande = "mailto:"; commande += FormatRecipient(listRecipient); commande += "?"; commande += "subject=" + FormatSubject(sSubject); commande += "&body="; commande += FormatBody(sBody); } public void Execute() { ProcessStartInfo oInfo = new ProcessStartInfo(commande); oInfo.LoadUserProfile = true; Process oProcess = new Process(); oProcess.StartInfo = oInfo; try { oProcess.Start(); } catch (Exception e) { throw new ApplicationException("haaaa dammit! : " + e.StackTrace); } }
Quelqu'un a-t-il une idée?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2 MailTo monMail = new MailTo(listRecipient,sujet,contenu); monMail.Execute();
Merci
Partager