dqask02082 2009-12-10 11:03
浏览 128
已采纳

多部分/混合电子邮件。 配有空身。 怎么了?

sending an email:

From: <...>
X-Mailer: SnowBoss
Reply-To: <...>
X-Priority: 3 (Normal)
Message-ID: <248.20091210135259@snowman2010.com>
To: <...>
Subject: =?UTF-8?B?0JzQntCZIFNVQkpFQ1Q=?=
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----------A4D921C2D10D7DB"

This is a multi-part message in MIME format.

----------A4D921C2D10D7DB
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

MY TEXT
----------A4D921C2D10D7DB
Content-Type: text/html;
charset=utf-8
Content-Transfer-Encoding: 8bit

<html><b>BOLD</b></html>
----------A4D921C2D10D7DB
.

<250 Data received OK. //server response

and it comes with empty body. This only happens with multipart/mixed content (tried multipart/alternative - same story)

  • 写回答

3条回答 默认 最新

  • dongpeng7744 2009-12-10 12:03
    关注

    As Tomasz mentioned, the line where you are using the boundary, you must have two hyphen at the beginning of your boundary separarator. Check the following:

    MIME-Version: 1.0
    Content-Type: multipart/mixed; boundary="frontier"
    
    This is a message with multiple parts in MIME format.
    --frontier
    Content-Type: text/plain
    
    This is the body of the message.
    --frontier
    Content-Type: application/octet-stream
    Content-Transfer-Encoding: base64
    
    PGh0bWw+CiAgPGhlYWQ+CiAgPC9oZWFkPgogIDxib2R5PgogICAgPHA+VGhpcyBpcyB0aGUg
    Ym9keSBvZiB0aGUgbWVzc2FnZS48L3A+CiAgPC9ib2R5Pgo8L2h0bWw+Cg==
    --frontier--
    

    Also notice that at the last boundary, you have to put another two hyphens to indicate that it's the end.

    Example taken from Wikipedia, see here.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?