Email Messages with Attachments using MIME

This section provides an email message example with an attachment using the MIME (Multipurpose Internet Mail Extensions) protocol. The message is divided into multiple parts with each part using different content type.

If you want to send email message with an attachment, you email program will use the MIME (Multipurpose Internet Mail Extensions) protocol to deliver your message together with the attachment.

Here is an example email message using MIME to delivery a picture as an attachment:

Received: by sphinx (mbox mlande) (with Cubic Circle's cucipop (v1...
X-From_: bob@internet.com Wed Aug 20 19:40:22 2003 
Return-Path: <bob@internet.com> 
Received: from psmtp.com (exprod5mx37.postini.com [12.158.34.194])...
Message-Id: <200308210240.h7L2e5A0016623@sphinx.got.net> 
Received: from source ([69.9.251.177]) by exprod5mx37.postini.com ...
From: "Bob Example" <bob@internet.com>
To: "Alice Example" <alice@internet.com>
Date: Wed, 20 Aug 2003 16:02:43 -0500
Subject: Test message
MIME-Version: 1.0
Content-Type: multipart/mixed;
        boundary="XXXXboundary text"

This is a multipart message in MIME format.

--XXXXboundary text 
Content-Type: text/plain

Hello Alice.
This is a test message with 5 lines in the message body
and an attachment.
Your friend,
Bob
--XXXXboundary text 
Content-Type: image/gif
Content-Transfer-Encoding: Base64
Content-Disposition: attachment; filename=smile.gif

/9j/4AAQSkZJRgABAQEAYABgAAD/4QAWRXhpZgAASUkqAAgAAAAAAAAAAAD/2wBDAA...
BwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PT...
...
X/76NHnS/wDPV/8Avo0f2Nh+7+9f5B/aNXsv6+Z//9k=

--XXXXboundary text--

Note that:

Last update: 2011.

Table of Contents

 About This Book

 Introduction of PKI (Public Key Infrastructure)

 Introduction of HTTPS (Hypertext Transfer Protocol Secure)

 Using HTTPS with Google Chrome

 Using HTTPS with Mozilla Firefox

 HTTPS with IE (Internet Explorer)

 Perl Scripts Communicating with HTTPS Servers

 PHP Scripts Communicating with HTTPS Servers

 Java Programs Communicating with HTTPS Servers

 Windows Certificate Stores and Console

 .NET Programs Communicating with HTTPS Servers

 CAcert.org - Root CA Offering Free Certificates

 PKI CA Administration - Issuing Certificates

 Comodo Free Personal Certificate

 Digital Signature - Microsoft Word

 Digital Signature - OpenOffice.org 3

S/MIME and Email Security

 What Is S/MIME?

 Digital Signature Scheme for Email Messages

 A Simple Email Message Example

Email Messages with Attachments using MIME

 Email Messages with Digital Signatures using S/MIME

 Encrypted Email Messages using S/MIME

 Digital Signature and Encryption in Outlook

 Email Security Settings in Outlook

 Valid Certificate Required in Outlook

 Message Security Properties in Outlook 2007

 Firefox Extension - Gmail S/MIME

 PKI (Public Key Infrastructure) Terminology

 Outdated Tutorials

 References

 Full Version in PDF/EPUB