0

Drupal 9.3.3

  • 模块 MimeMail
  • 邮件系统模块设置;使用 MimeMAil 作为格式化程序和发件人。
  • 我成功发送了一个测试 MimeMail
  • 但内容与 HTML 邮件不同。
  • 这是显示的邮件内容(不是代码):

This is a multi-part message in MIME format.

--20dff9a16b5198f0553cfc2d198f7a201cbebed81
Content-Type: multipart/alternative;
 boundary="7078940ec78091f01efed9a4d17f1784137cb90a0"
Content-Transfer-Encoding: 8bit


--7078940ec78091f01efed9a4d17f1784137cb90a0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit

CONTENT OF PLAIN TEXT FIELD IN TEST MIMEMAIL FORM
--7078940ec78091f01efed9a4d17f1784137cb90a0
Content-Type: text/html; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8Bit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Mime Mail Example message template</title>
  </head>
  <body id="mimemail-example-body" class="mimemail-example-test">
    <div id="center">
      <div id="main">
        CONTENT OF HTML FIELD IN TEST MIMEMAIL FORM
      </div>
    </div>
  </body>
</html>

--7078940ec78091f01efed9a4d17f1784137cb90a0--

--20dff9a16b5198f0553cfc2d198f7a201cbebed81--

我对邮件系统不是很熟悉。 html标签显示为纯文本的原因可能是什么?

这是邮件的代码:

Return-Path: <faoa3352@domain.net>
Delivered-To: myname@free.fr
Received: from capitale.jabatus.fr (mx15-g26.priv.proxad.net [172.20.243.85])
    by toaster2-g26.priv.proxad.net (Postfix) with ESMTP id 3415FD8058D
    for <myname@free.fr>; Wed,  2 Feb 2022 00:35:01 +0100 (CET)
Received: from capitale.jabatus.fr ([109.234.163.51])
    by mx1-g20.free.fr (MXproxy) with ESMTPS for myname@free.fr
    (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256);
    Wed,  2 Feb 2022 00:35:01 +0100 (CET)
X-ProXaD-SC: state=HAM score=0
X-ProXaD-Cause: (null)
X-Spam-Status: No
X-MailPropre-MailScanner-From: faoa3352@cantonais.o2switch.net
X-MailPropre-MailScanner-SpamCheck: not spam, SpamAssassin (not cached,
    score=0.401, required 5, autolearn=disabled, FREEFR 0.01,
    KAM_LOTSOFHASH 0.25, KAM_SHORT 1.00, RCVD_IN_DNSWL_HI 0.01,
    SERVINT 0.01, SPF_HELO_NONE 0.00, SPF_PASS -1.00, ST02 0.10,
    SUKC_2 0.01, VM03 0.01)
X-MailPropre-MailScanner: Not scanned: please contact your Internet E-Mail Service Provider for details
X-MailPropre-MailScanner-ID: 23D4B100499.AC917
X-MailPropre-MailScanner-Information: Please contact the ISP for more information
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
    d=faoa3352.odns.fr; s=default; h=Date:From:Message-Id:MIME-Version:Subject:To
    :Sender:Reply-To:Cc:Content-Type:Content-Transfer-Encoding:Content-ID:
    Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
    :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:
    List-Subscribe:List-Post:List-Owner:List-Archive;
    bh=YvftJrKmBeNP4umR5N/8QzQNVuXwfXnJ1C9WgM5Bv4Y=; b=AfgO5GvhTm2fuO5iAc0HYy2bs7
    u5kXFZ0ZIeFRGIxnwUMePgOERHOo8X3h+8cqJSkYYyRlmV5j8Nzgmj1oFLIJGA23Z2UogCLIXfn/t
    szVb+ZAn3RvXLKtby2nkiVya/8/8+z3ohCzupUVMMxFGvjcRBL59uYfLAvOgltnDPsJXinnEsuzMp
    ZYe3FdvalT7dQh5anEPhe6LjuMfuCyFDxP6Zz/EAxvfkaSKu1LBnMXsjrKha4PrAYwf7J7bS6ZQhO
    ha9iGMsryjl7QDBoI8N4yEoRY/PhPSQi3Vw++4Yi476aIevKymIqECVWO+myfc5xAkyQz8OKrzgeX
    e3dgTXPg==;
To: myname@free.fr
Subject: Test Mail
MIME-Version: 1.0
 Content-Type: multipart/mixed;
  boundary="6151d4616ca0bcf7ab13e4df7dfeb33596e00b4c1"
 Content-Transfer-Encoding: 8Bit
 X-Mailer: Drupal
 Sender: G-FAMILY <gilbert.admin@iaou.fr>
 From: G-FAMILY <gilbert.admin@iaou.fr>
Message-Id: <E1nF2fg-0002U1-Ou@cantonais.o2switch.net>
From: faoa3352@cantonais.o2switch.net
Date: Wed, 02 Feb 2022 00:34:48 +0100
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - cantonais.o2switch.net
X-AntiAbuse: Original Domain - free.fr
X-AntiAbuse: Originator/Caller UID/GID - [1078 994] / [47 12]
X-AntiAbuse: Sender Address Domain - cantonais.o2switch.net
X-Get-Message-Sender-Via: cantonais.o2switch.net: authenticated_id: faoa3352/primary_hostname/system user
X-Authenticated-Sender: cantonais.o2switch.net: faoa3352
X-Source: 
X-Source-Args: 
X-Source-Dir: faoa3352.odns.fr:/SITES/gfamily.iaou.fr

This is a multi-part message in MIME format.

--6151d4616ca0bcf7ab13e4df7dfeb33596e00b4c1
Content-Type: multipart/alternative;
 boundary="6d0a30d7981a4211f4855c18a1ed7354b284dbac0"
Content-Transfer-Encoding: 8bit


--6d0a30d7981a4211f4855c18a1ed7354b284dbac0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit

TEST  PLAIN TEXT
--6d0a30d7981a4211f4855c18a1ed7354b284dbac0
Content-Type: text/html; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8Bit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Mime Mail Example message template</title>
  </head>
  <body id="mimemail-example-body" class="mimemail-example-test mail">
    <div id="center">
      <div id="main">
        <strong>TEST  HTML TEXT </strong>
      </div>
    </div>
  </body>
</html>

--6d0a30d7981a4211f4855c18a1ed7354b284dbac0--

--6151d4616ca0bcf7ab13e4df7dfeb33596e00b4c1--

4

2 回答 2

0

您还必须将 mime 格式化程序添加到您的邮件设置中。

转到 admin/config/system/mailsystem 并对其进行配置,如下所示:

在此处输入图像描述

于 2022-02-03T12:37:21.613 回答
0

这就是我所做的,没有成功。

与此同时,我发现这个问题来自于错误的 mime 格式。在标题行的开头添加了一些空格。(见上面的邮件原始内容,就在“MIME-Version:1.0”行之后)

所以我从“MailSystem +MimeMail”转移到“SymfonyMailer”并且它工作正常。

于 2022-02-04T16:32:14.477 回答