2013-03-27 65 views
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-- 
. 

基於64位字符串解碼:螺紋IST EIN測試文本(這是一個測試文本)
如果我打開附件,它看起來像這樣:

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

換行符都是\ r \ n,如果我發送像PDF這樣的不同附件,我會在文檔中獲得此邊界。 任何想法可能是什麼? (其他一切工作)

回答

1

你的最後邊界缺少兩大連字符

--KCMailC68HStFfPS701hQuestionaryWySNk6-- 

嘗試將其更改爲

----KCMailC68HStFfPS701hQuestionaryWySNk6-- 

(和電子郵件缺少Date -Header,而不是導致你目前的問題,但你的下一個,如果你不添加它;-))

+0

-.-非常感謝。有時候我根本看不到這些東西...... – 2013-03-27 17:55:10