Я немного сбит с толку этим. Он отлично работает во всем, что я тестировал, кроме Outlook
<code> my @all_parts;
push @all_parts, Email::MIME->create(
body_str => $text,
attributes => {
encoding => 'quoted-printable',
content_type => "text/plain",
disposition => "inline",
charset => "UTF-8"
}
);
my $email = Email::MIME->create(
header_str => [
From => $from,
To => [ $to ],
Subject => $subject
],
parts => \@all_parts,
attributes => {
content_type => "multipart/mixed"
}
);
print "Content-type: text/html \n\n";
print "<pre>" . $email->as_string . "
";
, который выводит это сообщение:
From: delicia@x.com
To: andy.newby@hotmail.com
Subject: webform delicia Menu
Date: Sat, 21 Mar 2020 04:22:57 -0700
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="15847897770.621258BEF.22006"
Content-Transfer-Encoding: 7bit
--15847897770.621258BEF.22006
Date: Sat, 21 Mar 2020 04:22:57 -0700
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
foo bar=
--15847897770.621258BEF.22006--
По какой-то причине оно отображается с ошибками :
Я, должно быть, упускаю что-то действительно глупое - но я не вижу этого. Может быть, отсутствует заголовок?
полный источник входящей электронной почты выглядит следующим образом:
Return-path: <x@x.com>
Envelope-to: support@mysite.co.uk
Delivery-date: Sat, 21 Mar 2020 15:33:16 +0000
Received: from gt-van-cus5.nmsrv.com ([208.70.247.69])
by admin.foo.com with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.86_2)
(envelope-from <x@x.com>)
id 1jFg7e-0006lZ-G5
for support@mysite.co.uk; Sat, 21 Mar 2020 15:33:16 +0000
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=x.com; h=message-id
:from:to:subject:date:mime-version:content-type
:content-transfer-encoding; s=mail; bh=TUrwl9pmlEV+CwP8vMMqxIQa9
Bg=; b=G2DuFVkwBF8qkCi7zM3hnwl18nkdIW83JbAoheLTAG9Xh6Ix2bxdPVsP7
3wI1cjUDjWGhTUlMLHGKP5kHT4FPKFkhMclIv+KZ1jU65BaMjRuwWz/FkTRg7v6I
oClvU/PXXn5gqfRiYZHR4L8qgCQaGhuXncxNgtaELqoQosU+gc=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=x.com; h=message-id
:from:to:subject:date:mime-version:content-type
:content-transfer-encoding; q=dns; s=mail; b=VHNvnP4AnMZxow+CoUj
3Xxj5KkIWJtUOJf21kf+E/vhvKWbbb7IEWHFNuQGATCAG+WX529rMQ83l9KsDB9d
G9gRo0Hsw7CK2D56wv7m22ur6QeaCgZNF7xHEECxZkaT9jlI9JFLU8pSXaFvSEcC
YgqKlm2b+zs0Q4mW8mH89xiQ=
Received: (qmail 23888 invoked by uid 1000); 21 Mar 2020 15:33:12 -0000
X-AntiVirus: Clean
Message-ID: <20200321153311.23887.qmail@gt-van-cus5.nmsrv.com>
From: x@x.com
To: support@mysite.co.uk
Subject: =?UTF-8?B?d2ViZm9ybSA=?=
Date: Sat, 21 Mar 2020 08:33:11 -0700
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="15848047911.6F3Ff.23881"
Content-Transfer-Encoding: 7bit
X-Spam-Score: 16
X-Spam-Bar: +
X-Spam-Report: Spam detection software, running on the system "admin.foo.com",
has NOT identified this incoming email as spam. The original
message has been attached to this so you can view it or label
similar future email. If you have any questions, see
@@CONTACT_ADDRESS@@ for details.
Content preview: Date: Sat, 21 Mar 2020 08:33:11 -0700 MIME-Version: 1.0 Content-Type:
multipart/alternative; boundary="15848047910.05Ba9cd88.23881" [...]
Content analysis details: (1.6 points, 4.0 required)
pts rule name description
---- ---------------------- --------------------------------------------------
-0.0 SPF_HELO_PASS SPF: HELO matches SPF record
1.1 TRACKER_ID BODY: Incorporates a tracking ID number
0.0 T_TVD_MIME_NO_HEADERS BODY: No description available.
0.5 T_DKIM_INVALID DKIM-Signature header exists but is not valid
0.0 T_MIME_MALF Malformed MIME: headers in body
--15848047911.6F3Ff.23881
Date: Sat, 21 Mar 2020 08:33:11 -0700
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="15848047910.05Ba9cd88.23881"
Content-Transfer-Encoding: 7bit
--15848047910.05Ba9cd88.23881
Date: Sat, 21 Mar 2020 08:33:11 -0700
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
foo bar=
--15848047910.05Ba9cd88.23881
Date: Sat, 21 Mar 2020 08:33:11 -0700
MIME-Version: 1.0
Content-Type: text/html; charset="UTF-8"
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
some message=
--15848047910.05Ba9cd88.23881--
--15848047911.6F3Ff.23881
Date: Sat, 21 Mar 2020 08:33:11 -0700
MIME-Version: 1.0
Content-Type: image/jpeg; name="logo.jpg"
Content-Disposition: attachment; filename="logo.jpg"
Content-Transfer-Encoding: base64
/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAIBAQEBAQIBAQECAgICAgQDAgICAgUEBAMEBgUGBgYF
BgYGBwkIBgcJBwYGCAsICQoKCgoKBggLDAsKDAkKCgr/2wBDAQICAgICAgUDAwUKBwYHCgoKCgoK
CgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgr/wgARCAAlAPwDAREA
AhEBAxEB/8QAHAABAAMBAQEBAQAAAAAAAAAAAAUGBwgDBAIB/8QAFgEBAQEAAAAAAAAAAAAAAAAA
AAEC/9oADAMBAAIQAxAAAAHv4AHkeoAAAAAAAAAAAAABQk9yCNTWmpclpyXBYFPqII/hJkisen1H
4XySbX4SQK0kysSkqtUS5r6gAGfJRCxGnLxgx2c3x6z1cvLadBrnSWFcoTb1whOg1w9NeXyINN0a
yBPpMmTq1rgq47GmrkoAEWex+CQKelxWnJcVyxNTWLP0eJ9JnaamuWJqajIU0hfjSfWLSXXMksZa
lAAAAAAAAAAAEWSgABREvagD/8QAJRAAAgICAgEDBQEAAAAAAAAABQYDBAIHAAEgEhVACBARExQi
/9oACAEBAAEFAvCWaGDH5rm3WwcysHd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uul8E8eAZeSgbN6AhOB78gA4msoyhIuGSnARObjZHTTrOu6
Xbc940SHQoGhSC8IZX+byWmuAgaAA0GHpsP65R2J54Vwx+SxnAGg+GOSMlrIkOCNtjwHYW/gqz/t
+gKzELpQQi9mB14XkQDhDowVY+nkcjH+gTZgcoABAPWKqa4ABRbBNNK+HFHCFbICRMg0Dwp0gaUk
CDOzDsPiobCLn2z0QvkDcJgXUYDduu5pDXVqn6bSMQ1xfRzAdAYXGyQ84792K4p0gaUkCDOzDsPi
qde9slEbBY1yeEEiYCoJ52jQAA0AGX00fP8AOAcQLVUAI6G5jICKyoICawxhDSAE0AABoDGkYRiF
JsZzSisQW4PYQGSoEF2pQy9VWENTnRMfP5IxEHpTIFrXlda/QTK7xRzsZE5Bh/P/2Q==
--15848047911.6F3Ff.23881--
Странная часть действительно - это то, что EXACT тот же код отправляет нормально с одного из моих других серверов. Тем не менее, все заголовки MIME все Выглядят одинаково (за исключением того, что у них разные идентификаторы деталей и метки даты, очевидно :)). Я заставил хозяина разобраться в этом - в случае, если это проблема Exim, а не мой код. Хотя это выглядит очень странно!