gpt4 book ai didi

cocoa - 附件中的边界

转载 作者:行者123 更新时间:2023-12-03 17:54:34 25 4
gpt4 key购买 nike

我写了一个简单的邮件程序,但每次发送附件时,附件中都有我的边界。以下内容将发送至服务器:

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),我会在文档中得到此边界。有什么想法吗?(其他一切正常)

最佳答案

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

--KCMailC68HStFfPS701hQuestionaryWySNk6--

尝试将其更改为

----KCMailC68HStFfPS701hQuestionaryWySNk6--

(并且电子邮件缺少日期- header ,这不是您当前问题的原因,但如果您不添加它,则会导致下一个问题;-) )

关于cocoa - 附件中的边界,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15662163/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com