-3 networking network-programming cisco protocols email-attachments
据我所知,有以下协议用于发送和接收电子邮件:
这些协议中的哪些用于在电子邮件中发送附件?发送电子邮件时 FTP 或 TFTP 有什么作用吗?
这些协议中的哪些用于在电子邮件中发送附件?
要将附件嵌入到电子邮件中,我们通常使用RFC 2045 中描述的多用途 Internet 邮件扩展 (MIME) 。
基本上,要发送附件,我们将电子邮件分成几部分,因此第一部分是文本,下一部分是附件,反之亦然。
要查看原始电子邮件结构,我们可以在带有附件的电子邮件上单击“显示原始”。结果将如下所示:
From: Whomever
To: Someone
Date: Whenever
Subject: whatever
MIME-Version: 1.0
Message-ID: <id1@host.com>
Content-Type: multipart/alternative; boundary=42
Content-ID: <id001@guppylake.bellcore.com>
--42
Content-Type: message/external-body; name="BodyFormats.ps";
site="thumper.bellcore.com"; mode="image";
access-type=ANON-FTP; directory="pub";
expiration="Fri, 14 Jun 1991 19:13:14 -0400 (EDT)"
Content-type: application/postscript
Content-ID: <id42@guppylake.bellcore.com>
--42
Content-Type: message/external-body; access-type=local-file;
name="/u/nsb/writing/rfcs/RFC-MIME.ps";
site="thumper.bellcore.com";
expiration="Fri, 14 Jun 1991 19:13:14 -0400 (EDT)"
Content-type: application/postscript
Content-ID: <id42@guppylake.bellcore.com>
--42
Content-Type: message/external-body;
access-type=mail-server
server="listserv@bogus.bitnet";
expiration="Fri, 14 Jun 1991 19:13:14 -0400 (EDT)"
Content-type: application/postscript
Content-ID: <id42@guppylake.bellcore.com>
get RFC-MIME.DOC
--42--
Run Code Online (Sandbox Code Playgroud)
这是RFC 2046 中的一个示例。这就是我们在消息中嵌入附件的方式。
要发送带有附件的邮件,我们使用 SMTP。IMAP 可用于将电子邮件从客户端传输到我们服务器上的文件夹,但它不用于向其他用户发送电子邮件。
发送电子邮件时 FTP 或 TFTP 有什么作用吗?
不可以。FTP/TFTP 协议不用于电子邮件。这些是用于传输文件 (FTP) 或用于从网络启动 (TFTP) 的单独协议。