0

我写了一个简单的邮件,但每次我发送附件时,我都会在附件中找到我的边界。以下内容进入服务器:

From: Some valid E-Mail
Reply-To: The same valid E-Mail
To: my E-Mail (hosted by 1&1)
Cc: 
Bcc: 
Subject: Anhang Serie
MIME-Version: 1.0
X-Mailer: KizzyCode Mailer 0.1
X-Priority: 1
Content-Type: multipart/mixed;
     boundary="--KCMailC68HStFfPS701hQuestionaryWySNk6"

This is a multi-part message in MIME format.

----KCMailC68HStFfPS701hQuestionaryWySNk6
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<title></title>
<meta name="Generator" content="Cocoa HTML Writer">
<meta name="CocoaVersion" content="1187.37">
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica}
</style>
</head>
<body>
<p class="p1">TestText</p>
</body>
</html>


----KCMailC68HStFfPS701hQuestionaryWySNk6
Content-Type: text/plain;
     name="splittet Kopie.txt"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;    filename="splittet Kopie.txt"

RGllcyBpc3QgZWluIFRlc3QtVGV4dA==

--KCMailC68HStFfPS701hQuestionaryWySNk6--
.

base64 字符串被解码:Dies ist ein Test-Text (这是一个测试文本)
如果我打开附件,它看起来像这样:

 <br>
Dies ist ein Test-Tex--KCMailC68HStFfPS701hQuestionaryWySNk6--t

换行符都是\r\n,如果我发送一个不同的附件,比如PDF,我会在文档中得到这个边界。有什么想法吗?(其他一切正常)

4

1 回答 1

1

您的最后一个边界缺少两个前导连字符

--KCMailC68HStFfPS701hQuestionaryWySNk6--

尝试将其更改为

----KCMailC68HStFfPS701hQuestionaryWySNk6--

(并且电子邮件缺少Date-Header,不是您当前问题的原因,而是您的下一个问题,如果您不添加它;-))

于 2013-03-27T16:55:24.973 回答