diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php
index 72fd29168ad..a0143ed07ed 100644
--- a/htdocs/core/class/html.formmail.class.php
+++ b/htdocs/core/class/html.formmail.class.php
@@ -1563,7 +1563,7 @@ class FormMail extends Form
// Envoyer le contenu HTML à process_template.php pour traitement PHP
$.ajax({
type: "POST",
- url: "/core/ajax/mailtemplate.php",
+ url: "'.DOL_URL_ROOT.'/core/ajax/mailtemplate.php",
data: { content: contentHtml, token: csrfToken },
success: function(response) {
jQuery("#'.dol_sanitizeKeyCode($htmlContent).'").val(response);