# Re: vb的WINSOCK元件该如何传送附件？

Posted by OO on March 12, 1999 at 15:43:29:

In Reply to: vb的WINSOCK元件该如何传送附件？ posted by 飞云 on March 12, 1999 at 09:30:55:

: 我试过以winsock的传送信件，但是附件呢？
: 使用ftp吗？

您如果要传送附加档案的话, 就需要使用对方邮件主机
认得的邮件格式自行编码啦, 一般来说可以用 base64
或是 uuencode.
其实传送附件的邮件格式就是与 CGI 的 Multipart
POST Method 的格式是相同的. 你可以由此查到相关的
资料.

传送附件档的邮件范例如下.

Date: Tue, 10 Mar 1999 23:44:07 +0800
To: nobody@iName.com
Subject: Hello!
Content-Type: multipart/mixed; boundary="------------C36922F86CC78476AD079796"

This is a multi-part message in MIME format.
--------------C36922F86CC78476AD079796
Content-Type: text/plain; charset=iso-8859-1
X-MIME-Autoconverted: from 8bit to base64 by smv06.globecomm.net id KAA26241
Content-Transfer-Encoding: base64

SGkNCiAgqvizfrlxuNyvZKilq9yu9rZPs+GhSSAgIDopDQogIFRrcyBhbnl3YXkhDQoNCiAg
p9qycadBpWmv4KhTrN25TKRwpP2kbKdhoUkNCiAgprOqxaq6uNzASKtLrN2s3aFBq9y1daFC
q9ylabdSoUkNCg0KIKTTsd+kfqZZsd/AXLnvqK3F6aSjpGqmbqFBrW6maKtPrauw2qFJDQoN
CiAgsd+md34NCg0KIEVsYWluDQo=
--------------C36922F86CC78476AD079796
Content-Type: application/x-zip-compressed; name="AAA.zip"
Content-Disposition: inline; filename="AAA.zip"
Content-Transfer-Encoding: base64

UEsDBBQAAgAAAGmliSMAAAAAAAAAAAAAAAAHAAAApHCk/aRsL1BLAwQUAAIACAD7angjGMyO
lPgAAACLAgAAEAAAAKRwpP2kbC9pbmRleC5odG21UrFOBCEQ7U38B4K5zsBaamBLY3MWWliz
7LhgOCDsbE4t/Jr9TRM5uNOL2Upzr5rJvHmPF0YY3Lj2/IwQYUD1pco1WnTQznH+nJ3gtduP
bpPawAhIHsJ2lPS6WV1eNSu6H1dUElmrNFj/ZHs0siHHhAMq4w7sYFA2S4z7LCTpWllPl8aP
OgXnrB8kVRMGuugyJl0l2C4tJRij6vLbDWK84TxoUJ45/WIYRs2gnxhu+YezE4/Jeg38aNeH
--------------C36922F86CC78476AD079796--

Follow Ups:

- Re: vb的WINSOCK元件该如何传送附件？ 飞云 16:50:11 3/19/99 (0)