summaryrefslogtreecommitdiffstats
path: root/mimelib/test
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit460c52653ab0dcca6f19a4f492ed2c5e4e963ab0 (patch)
tree67208f7c145782a7e90b123b982ca78d88cc2c87 /mimelib/test
downloadtdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.tar.gz
tdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'mimelib/test')
-rw-r--r--mimelib/test/INSTALL26
-rw-r--r--mimelib/test/exampl01.cpp80
-rw-r--r--mimelib/test/exampl01.txt34
-rw-r--r--mimelib/test/exampl02.cpp84
-rw-r--r--mimelib/test/exampl02.txt32
-rw-r--r--mimelib/test/exampl03.cpp95
-rw-r--r--mimelib/test/exampl03.txt28
-rw-r--r--mimelib/test/exampl04.cpp113
-rw-r--r--mimelib/test/exampl04.txt73
-rw-r--r--mimelib/test/exampl05.cpp77
-rw-r--r--mimelib/test/exampl05.txt34
11 files changed, 676 insertions, 0 deletions
diff --git a/mimelib/test/INSTALL b/mimelib/test/INSTALL
new file mode 100644
index 000000000..822915e34
--- /dev/null
+++ b/mimelib/test/INSTALL
@@ -0,0 +1,26 @@
+Sorry, there's no autoconf script available yet. However, there are comments
+in the makefile to help you out, and there are not a lot of changes to make.
+There are different options available, some of which are platform dependent.
+For example, under Win32 you can compile the library as a .LIB or as a .DLL.
+To change any of the defaults, edit the file ./mimepp/config.h. It's
+probably a good idea to take a look at that file anyway.
+
+There are several makefiles available. Makefile.unx is a makefile for a
+generic UNIX system. Makefile.vc is a makefile for Visual C++ 4 or 5.
+Makefile.bc is a makefile for Borland C++ 5.
+
+If you are using the library on a non-UNIX system, such as Windows 3.1 or
+Macintosh, you will probably need to change msgid.cpp. The function
+DwMsgId::CreateDefault() needs to get the host name and the process ID to
+create a msg-id. I put some conditional compilation macros in to support
+Winsock, but I have not tested it under Windows 3.1. If you do not know how
+to get your host name, you can set the static member DwMsgId::sHostName
+before using the library functions.
+
+On a UNIX system:
+
+Typing 'make -f makefile.unx' will make the library libmimepp.a and the
+example programs exampl01, exampl02, exampl03, exampl04, exampl05;
+typing 'make lib' will make just the library. Finally, type 'make install
+' to copy the include files to /usr/local/include/mimepp and the library
+to /usr/local/lib.
diff --git a/mimelib/test/exampl01.cpp b/mimelib/test/exampl01.cpp
new file mode 100644
index 000000000..497383bf9
--- /dev/null
+++ b/mimelib/test/exampl01.cpp
@@ -0,0 +1,80 @@
+//=============================================================================
+// File: exampl01.cpp
+// Contents: Source code for Example 1 -- Creating a simple message
+// Maintainer: Doug Sauder <dwsauder@fwb.gulf.net>
+// WWW: http://www.fwb.gulf.net/~dwsauder/mimepp.html
+//
+// Copyright (c) 1996, 1997 Douglas W. Sauder
+// All rights reserved.
+//
+// IN NO EVENT SHALL DOUGLAS W. SAUDER BE LIABLE TO ANY PARTY FOR DIRECT,
+// INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF
+// THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF DOUGLAS W. SAUDER
+// HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// DOUGLAS W. SAUDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT
+// NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+// PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS"
+// BASIS, AND DOUGLAS W. SAUDER HAS NO OBLIGATION TO PROVIDE MAINTENANCE,
+// SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+//
+//=============================================================================
+
+#include <stdlib.h>
+#include <time.h>
+#include <iostream>
+#include <fstream>
+#include "basicmsg.h"
+
+int main()
+{
+ // Initialize the library
+
+ DwInitialize();
+
+ // Get a buffer of data from a text file
+
+ DwString buffer = "";
+ DwString line;
+ std::ifstream istrm("exampl01.txt");
+ while (DwTrue) {
+ getline(istrm, line);
+ if (istrm.eof()) {
+ break;
+ }
+ buffer += line + DW_EOL;
+ }
+ istrm.close();
+
+ // Create a message
+
+ BasicMessage msg;
+
+ // Create MIME-Version and Message-id header fields
+
+ msg.SetAutomaticFields();
+
+ // Set header fields
+
+ msg.SetDate(time(NULL));
+ msg.SetTypeStr("Text");
+ msg.SetSubtypeStr("Plain");
+ msg.SetCteStr("7bit");
+ msg.SetFrom("Emily Postnews <emily.postnews@usenet.com>");
+ msg.SetTo("verbose@noisy");
+ msg.SetCc("forgetful@myvax");
+ msg.SetBcc("eager@beaver.dam");
+ msg.SetSubject("Re: How long should my signature be?");
+
+ // Set body
+
+ msg.SetBody(buffer);
+
+ // Write it to a file
+
+ std::ofstream ostrm("exampl01.out");
+ ostrm << msg.AsString();
+
+ return 0;
+}
+
diff --git a/mimelib/test/exampl01.txt b/mimelib/test/exampl01.txt
new file mode 100644
index 000000000..88e0ba608
--- /dev/null
+++ b/mimelib/test/exampl01.txt
@@ -0,0 +1,34 @@
+> Dear Miss Postnews:
+>
+> How long should my signature be?
+>
+> -- verbose@noisy
+
+Dear Verbose:
+
+Please try and make your signature as long as you can. It's much more
+important than your article, of course, so try and have more lines of
+signature than actual text.
+
+Try and include a large graphic made of ASCII characters, plus lots of cute
+quotes and slogans. People will never tire of reading these pearls of wisdom
+again and again, and you will soon become personally associated with the joy
+each reader feels at seeing yet another delightful repeat of your signature.
+
+Be sure as well to include a complete map of USENET with each signature, to
+show how anybody can get mail to you from any site in the world. Be sure to
+include ARPA gateways as well. Also tell people on your own site how to mail
+to you. Give independent addresses for Internet, UUCP, BITNET, Arpanet and
+CSNET, even if they're all the same.
+
+Aside from your reply address, include your full name, company and
+organization. It's just common courtesy -- after all, in some newsreaders
+people have to type an *entire* keystroke to go back to the top of your
+article to see this information in the header.
+
+By all means include your phone number and street address in every single
+article. People are always responding to usenet articles with phone calls
+and letters. It would be silly to go to the extra trouble of including this
+information only in articles that need a response by conventional channels!
+
+Em
diff --git a/mimelib/test/exampl02.cpp b/mimelib/test/exampl02.cpp
new file mode 100644
index 000000000..600df8a6b
--- /dev/null
+++ b/mimelib/test/exampl02.cpp
@@ -0,0 +1,84 @@
+//=============================================================================
+// File: exampl02.cpp
+// Contents: Source code for Example 2 -- Parsing a simple message
+// Maintainer: Doug Sauder <dwsauder@fwb.gulf.net>
+// WWW: http://www.fwb.gulf.net/~dwsauder/mimepp.html
+//
+// Copyright (c) 1996, 1997 Douglas W. Sauder
+// All rights reserved.
+//
+// IN NO EVENT SHALL DOUGLAS W. SAUDER BE LIABLE TO ANY PARTY FOR DIRECT,
+// INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF
+// THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF DOUGLAS W. SAUDER
+// HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// DOUGLAS W. SAUDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT
+// NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+// PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS"
+// BASIS, AND DOUGLAS W. SAUDER HAS NO OBLIGATION TO PROVIDE MAINTENANCE,
+// SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+//
+//=============================================================================
+
+#include <stdlib.h>
+#include <iostream>
+#include <fstream>
+#include "basicmsg.h"
+
+#include <mimelib/token.h>
+
+
+int main()
+{
+ // Initialize the library
+
+ DwInitialize();
+
+ // Read message from file
+
+ DwString messageStr = "";
+ DwString line;
+ std::ifstream istrm("exampl02.txt");
+ while (DwTrue) {
+ getline(istrm, line);
+ if (istrm.eof()) {
+ break;
+ }
+ messageStr += line + DW_EOL;
+ }
+ istrm.close();
+
+ // Create a DwMessage and parse it. The DwMessage should be created on
+ // the free store, since it will be added to the BasicMessage.
+
+ DwMessage* msg = DwMessage::NewMessage(messageStr, 0);
+ msg->Parse();
+
+ // Create a Message and add the DwMessage to it
+
+ BasicMessage message(msg);
+
+ // Open file stream for output
+
+ std::ofstream ostrm("exampl02.out");
+
+ // Print the header fields
+
+ ostrm << "Type -> " << message.TypeStr() << std::endl;
+ ostrm << "Subtype -> " << message.SubtypeStr() << std::endl;
+ ostrm << "Content-Transfer-Encoding -> " << message.CteStr() << std::endl;
+ ostrm << "Date -> " << message.DateStr() << std::endl;
+ ostrm << "From -> " << message.From() << std::endl;
+ ostrm << "To -> " << message.To() << std::endl;
+ ostrm << "Cc -> " << message.Cc() << std::endl;
+ ostrm << "Bcc -> " << message.Bcc() << std::endl;
+ ostrm << "Subject -> " << message.Subject() << std::endl;
+
+ // Print the body
+
+ ostrm << "\nBody ->" << std::endl;
+ ostrm << message.Body() << std::endl;
+
+ return 0;
+}
+
diff --git a/mimelib/test/exampl02.txt b/mimelib/test/exampl02.txt
new file mode 100644
index 000000000..b80e9be75
--- /dev/null
+++ b/mimelib/test/exampl02.txt
@@ -0,0 +1,32 @@
+MIME-Version: 1.0
+Message-Id: <97082402002000.00107@kaybee>
+Date: Sun, 24 Aug 1997 02:00:20 -0500
+Content-Type: Text/Plain
+Content-Transfer-Encoding: 7bit
+From: Emily Postnews <emily.postnews@usenet.com>
+To: verbose@noisy
+Cc: forgetful@myvax
+Bcc: eager@beaver.dam
+Subject: Re: Forgot my signature!
+
+> Dear Emily
+>
+> Today I posted an article and forgot to include my signature. What should I
+> do?
+>
+> -- forgetful@myvax
+
+Dear Forgetful:
+
+Rush to your terminal right away and post an article that says, "Oops, I
+forgot to post my signature with that last article. Here it is."
+
+Since most people will have forgotten your earlier article, (particularly
+since it dared to be so boring as to not have a nice, juicy signature) this
+will remind them of it. Besides, people care much more about the signature
+anyway. See the previous letter for more important details.
+
+Also, be sure to include your signature TWICE in each article. That way
+you're sure people will read it.
+
+Em
diff --git a/mimelib/test/exampl03.cpp b/mimelib/test/exampl03.cpp
new file mode 100644
index 000000000..02350e9db
--- /dev/null
+++ b/mimelib/test/exampl03.cpp
@@ -0,0 +1,95 @@
+//=============================================================================
+// File: exampl03.cpp
+// Contents: Source code for Example 3 -- Creating a multipart message
+// Maintainer: Doug Sauder <dwsauder@fwb.gulf.net>
+// WWW: http://www.fwb.gulf.net/~dwsauder/mimepp.html
+//
+// Copyright (c) 1996, 1997 Douglas W. Sauder
+// All rights reserved.
+//
+// IN NO EVENT SHALL DOUGLAS W. SAUDER BE LIABLE TO ANY PARTY FOR DIRECT,
+// INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF
+// THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF DOUGLAS W. SAUDER
+// HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// DOUGLAS W. SAUDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT
+// NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+// PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS"
+// BASIS, AND DOUGLAS W. SAUDER HAS NO OBLIGATION TO PROVIDE MAINTENANCE,
+// SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+//
+//=============================================================================
+
+#include <stdlib.h>
+#include <time.h>
+#include <iostream>
+#include <fstream>
+#include "multipar.h"
+
+
+int main()
+{
+ // Initialize the library
+
+ DwInitialize();
+
+ // Get a buffer of data from a text file
+
+ DwString buffer = "";
+ DwString line;
+ std::ifstream istrm("exampl03.txt");
+ while (DwTrue) {
+ getline(istrm, line);
+ if (istrm.eof()) {
+ break;
+ }
+ buffer += line + DW_EOL;
+ }
+ istrm.close();
+
+ // Create a MultipartMessage
+
+ MultipartMessage msg;
+
+ // Create MIME-Version and Message-id header fields
+
+ msg.SetAutomaticFields();
+
+ // Set header fields
+
+ DwUint32 t = (DwUint32) time(NULL);
+ msg.SetDate(t);
+ msg.SetFrom("Emily Postnews <emily.postnews@usenet.com>");
+ msg.SetTo("verbose@noisy");
+ msg.SetCc("forgetful@myvax");
+ msg.SetBcc("eager@beaver.dam");
+ msg.SetSubject("Getting email through");
+
+ // Add body part 1
+
+ MultipartBodyPart part;
+ part.SetType(DwMime::kTypeText);
+ part.SetSubtype(DwMime::kSubtypePlain);
+ part.SetContentTransferEncoding(DwMime::kCte7bit);
+ part.SetContentDescription("text, unencoded");
+ part.SetBody(buffer);
+ msg.AddBodyPart(part);
+
+ // Add body part 2
+
+ part.SetType(DwMime::kTypeText);
+ part.SetSubtype(DwMime::kSubtypePlain);
+ part.SetContentTransferEncoding(DwMime::kCteBase64);
+ part.SetContentDescription("text, base64 encoded");
+ DwString ascData;
+ DwEncodeBase64(buffer, ascData);
+ part.SetBody(ascData);
+ msg.AddBodyPart(part);
+
+ // Write it to a file
+
+ std::ofstream ostrm("exampl03.out");
+ ostrm << msg.AsString();
+
+ return 0;
+}
diff --git a/mimelib/test/exampl03.txt b/mimelib/test/exampl03.txt
new file mode 100644
index 000000000..63609e141
--- /dev/null
+++ b/mimelib/test/exampl03.txt
@@ -0,0 +1,28 @@
+> Dear Ms. Postnews:
+>
+> I couldn't get mail through to somebody on another site. What should I do?
+>
+> -- eager@beaver.dam
+
+Dear Eager:
+
+No problem, just post your message to a group that a lot of people read.
+Say, "This is for John Smith. I couldn't get mail through so I'm posting it.
+All others please ignore."
+
+This way tens of thousands of people will spend a few seconds scanning over
+and ignoring your article, using up over 16 man-hours of their collective
+time, but you will be saved the terrible trouble of checking through usenet
+maps or looking for alternate routes. Just think, if you couldn't distribute
+your message to 9000 other computers, you might actually have to (gasp) call
+directory assistance for 60 cents, or even phone the person. This can cost
+as much as a few DOLLARS (!) for a 5 minute call!
+
+And certainly it's better to spend 10 to 20 dollars of other people's money
+distributing the message than for you to have to waste $9 on an overnight
+letter, or even 29 cents on a stamp!
+
+Don't forget. The world will end if your message doesn't get through, so
+post it as many places as you can.
+
+Em
diff --git a/mimelib/test/exampl04.cpp b/mimelib/test/exampl04.cpp
new file mode 100644
index 000000000..7a0b5d078
--- /dev/null
+++ b/mimelib/test/exampl04.cpp
@@ -0,0 +1,113 @@
+//=============================================================================
+// File: exampl04.cpp
+// Contents: Source code for Example 4 -- Parsing a multipart message
+// Maintainer: Doug Sauder <dwsauder@fwb.gulf.net>
+// WWW: http://www.fwb.gulf.net/~dwsauder/mimepp.html
+//
+// Copyright (c) 1996, 1997 Douglas W. Sauder
+// All rights reserved.
+//
+// IN NO EVENT SHALL DOUGLAS W. SAUDER BE LIABLE TO ANY PARTY FOR DIRECT,
+// INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF
+// THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF DOUGLAS W. SAUDER
+// HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// DOUGLAS W. SAUDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT
+// NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+// PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS"
+// BASIS, AND DOUGLAS W. SAUDER HAS NO OBLIGATION TO PROVIDE MAINTENANCE,
+// SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+//
+//=============================================================================
+
+#include <stdlib.h>
+#include <iostream>
+#include <fstream>
+#include "multipar.h"
+
+
+int main()
+{
+ // Initialize the library
+
+ DwInitialize();
+
+ // Read message from file
+
+ DwString messageStr = "";
+ DwString line;
+ std::ifstream istrm("exampl04.txt");
+ while (DwTrue) {
+ getline(istrm, line);
+ if (istrm.eof()) {
+ break;
+ }
+ messageStr += line + DW_EOL;
+ }
+ istrm.close();
+
+ // Create a DwMessage and parse it. The DwMessage should be created on
+ // the free store, since it will be added to the MultipartMessage.
+
+ DwMessage* msg = DwMessage::NewMessage(messageStr, 0);
+ msg->Parse();
+
+ // Make sure it is a multipart message
+ // If is not a multipart message, we could create a BasicMessage instead,
+ // but we won't do that in this example.
+
+ if (msg->Headers().ContentType().Type() != DwMime::kTypeMultipart) {
+ std::cerr << "Not a multipart message\n";
+ return 0;
+ }
+
+ // Create a MultipartMessage
+
+ MultipartMessage multipart(msg);
+
+ // Open file stream for output
+
+ std::ofstream ostrm("exampl04.out");
+
+ // Print the header fields
+
+ ostrm << "Type -> " << multipart.TypeStr() << std::endl;
+ ostrm << "Subtype -> " << multipart.SubtypeStr() << std::endl;
+ ostrm << "Date -> " << multipart.DateStr() << std::endl;
+ ostrm << "From -> " << multipart.From() << std::endl;
+ ostrm << "To -> " << multipart.To() << std::endl;
+ ostrm << "Cc -> " << multipart.Cc() << std::endl;
+ ostrm << "Bcc -> " << multipart.Bcc() << std::endl;
+ ostrm << "Subject -> " << multipart.Subject() << std::endl;
+
+ // Read the body parts and print them
+
+ MultipartBodyPart part;
+ DwString body;
+ int numParts = multipart.NumberOfParts();
+ for (int idx=0; idx < numParts; ++idx) {
+ multipart.BodyPart(idx, part);
+ ostrm << "\nBody part number " << idx << std::endl;
+ ostrm << "Type -> " << part.TypeStr() << std::endl;
+ ostrm << "Subtype -> " << part.SubtypeStr() << std::endl;
+ ostrm << "Content transfer encoding -> "
+ << part.ContentTransferEncodingStr() << std::endl;
+ ostrm << "Content description -> "
+ << part.ContentDescription() << std::endl;
+ int cte = part.ContentTransferEncoding();
+ if (cte == DwMime::kCteBase64) {
+ DwDecodeBase64(part.Body(), body);
+ ostrm << "Body (decoded) ->" << std::endl << body << std::endl;
+ }
+ else if (cte == DwMime::kCteQuotedPrintable) {
+ DwDecodeQuotedPrintable(part.Body(), body);
+ ostrm << "Body (decoded) ->" << std::endl << body << std::endl;
+ }
+ else {
+ body = part.Body();
+ ostrm << "Body ->" << std::endl << body << std::endl;
+ }
+ }
+ return 0;
+}
+
diff --git a/mimelib/test/exampl04.txt b/mimelib/test/exampl04.txt
new file mode 100644
index 000000000..9574c5194
--- /dev/null
+++ b/mimelib/test/exampl04.txt
@@ -0,0 +1,73 @@
+MIME-Version: 1.0
+Message-Id: <97082402123500.00119@kaybee>
+Content-Type: Multipart/Mixed;
+ boundary="Boundary-=_pHqghUmeaYlNlfdXfircvsCxgGBw"
+Date: Sun, 24 Aug 1997 02:12:35 -0500
+From: Emily Postnews <emily.postnews@usenet.com>
+To: verbose@noisy
+Cc: forgetful@myvax
+Bcc: eager@beaver.dam
+Subject: Getting email through
+
+
+--Boundary-=_pHqghUmeaYlNlfdXfircvsCxgGBw
+Content-Type: Text/Plain
+Content-Transfer-Encoding: 7bit
+Content-Description: text, unencoded
+
+> Dear Ms. Postnews:
+>
+> I couldn't get mail through to somebody on another site. What should I do?
+>
+> -- eager@beaver.dam
+
+Dear Eager:
+
+No problem, just post your message to a group that a lot of people read.
+Say, "This is for John Smith. I couldn't get mail through so I'm posting it.
+All others please ignore."
+
+This way tens of thousands of people will spend a few seconds scanning over
+and ignoring your article, using up over 16 man-hours of their collective
+time, but you will be saved the terrible trouble of checking through usenet
+maps or looking for alternate routes. Just think, if you couldn't distribute
+your message to 9000 other computers, you might actually have to (gasp) call
+directory assistance for 60 cents, or even phone the person. This can cost
+as much as a few DOLLARS (!) for a 5 minute call!
+
+And certainly it's better to spend 10 to 20 dollars of other people's money
+distributing the message than for you to have to waste $9 on an overnight
+letter, or even 29 cents on a stamp!
+
+Don't forget. The world will end if your message doesn't get through, so
+post it as many places as you can.
+
+Em
+
+--Boundary-=_pHqghUmeaYlNlfdXfircvsCxgGBw
+Content-Type: Text/Plain
+Content-Transfer-Encoding: base64
+Content-Description: text, base64 encoded
+
+PiBEZWFyIE1zLiBQb3N0bmV3czoKPgo+IEkgY291bGRuJ3QgZ2V0IG1haWwgdGhyb3VnaCB0byBz
+b21lYm9keSBvbiBhbm90aGVyIHNpdGUuIFdoYXQgc2hvdWxkIEkgZG8/Cj4KPiAtLSBlYWdlckBi
+ZWF2ZXIuZGFtCgpEZWFyIEVhZ2VyOgoKTm8gcHJvYmxlbSwganVzdCBwb3N0IHlvdXIgbWVzc2Fn
+ZSB0byBhIGdyb3VwIHRoYXQgYSBsb3Qgb2YgcGVvcGxlIHJlYWQuClNheSwgIlRoaXMgaXMgZm9y
+IEpvaG4gU21pdGguIEkgY291bGRuJ3QgZ2V0IG1haWwgdGhyb3VnaCBzbyBJJ20gcG9zdGluZyBp
+dC4KQWxsIG90aGVycyBwbGVhc2UgaWdub3JlLiIKClRoaXMgd2F5IHRlbnMgb2YgdGhvdXNhbmRz
+IG9mIHBlb3BsZSB3aWxsIHNwZW5kIGEgZmV3IHNlY29uZHMgc2Nhbm5pbmcgb3ZlcgphbmQgaWdu
+b3JpbmcgeW91ciBhcnRpY2xlLCB1c2luZyB1cCBvdmVyIDE2IG1hbi1ob3VycyBvZiB0aGVpciBj
+b2xsZWN0aXZlCnRpbWUsIGJ1dCB5b3Ugd2lsbCBiZSBzYXZlZCB0aGUgdGVycmlibGUgdHJvdWJs
+ZSBvZiBjaGVja2luZyB0aHJvdWdoIHVzZW5ldAptYXBzIG9yIGxvb2tpbmcgZm9yIGFsdGVybmF0
+ZSByb3V0ZXMuIEp1c3QgdGhpbmssIGlmIHlvdSBjb3VsZG4ndCBkaXN0cmlidXRlCnlvdXIgbWVz
+c2FnZSB0byA5MDAwIG90aGVyIGNvbXB1dGVycywgeW91IG1pZ2h0IGFjdHVhbGx5IGhhdmUgdG8g
+KGdhc3ApIGNhbGwKZGlyZWN0b3J5IGFzc2lzdGFuY2UgZm9yIDYwIGNlbnRzLCBvciBldmVuIHBo
+b25lIHRoZSBwZXJzb24uIFRoaXMgY2FuIGNvc3QKYXMgbXVjaCBhcyBhIGZldyBET0xMQVJTICgh
+KSBmb3IgYSA1IG1pbnV0ZSBjYWxsIQoKQW5kIGNlcnRhaW5seSBpdCdzIGJldHRlciB0byBzcGVu
+ZCAxMCB0byAyMCBkb2xsYXJzIG9mIG90aGVyIHBlb3BsZSdzIG1vbmV5CmRpc3RyaWJ1dGluZyB0
+aGUgbWVzc2FnZSB0aGFuIGZvciB5b3UgdG8gaGF2ZSB0byB3YXN0ZSAkOSBvbiBhbiBvdmVybmln
+aHQKbGV0dGVyLCBvciBldmVuIDI5IGNlbnRzIG9uIGEgc3RhbXAhCgpEb24ndCBmb3JnZXQuIFRo
+ZSB3b3JsZCB3aWxsIGVuZCBpZiB5b3VyIG1lc3NhZ2UgZG9lc24ndCBnZXQgdGhyb3VnaCwgc28K
+cG9zdCBpdCBhcyBtYW55IHBsYWNlcyBhcyB5b3UgY2FuLgoKRW0K
+
+--Boundary-=_pHqghUmeaYlNlfdXfircvsCxgGBw--
diff --git a/mimelib/test/exampl05.cpp b/mimelib/test/exampl05.cpp
new file mode 100644
index 000000000..5e3b16d86
--- /dev/null
+++ b/mimelib/test/exampl05.cpp
@@ -0,0 +1,77 @@
+//=============================================================================
+// File: exampl05.cpp
+// Contents: Source code for Example 5 -- Creating a message with
+// Maintainer: Doug Sauder <dwsauder@fwb.gulf.net>
+// WWW: http://www.fwb.gulf.net/~dwsauder/mimepp.html
+//
+// Copyright (c) 1996, 1997 Douglas W. Sauder
+// All rights reserved.
+//
+// IN NO EVENT SHALL DOUGLAS W. SAUDER BE LIABLE TO ANY PARTY FOR DIRECT,
+// INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF
+// THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF DOUGLAS W. SAUDER
+// HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// DOUGLAS W. SAUDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT
+// NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+// PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS"
+// BASIS, AND DOUGLAS W. SAUDER HAS NO OBLIGATION TO PROVIDE MAINTENANCE,
+// SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+//
+//=============================================================================
+
+#include <stdlib.h>
+#include <time.h>
+#include <iostream>
+#include <fstream>
+#include "attach.h"
+
+
+int main()
+{
+ // Initialize the library
+
+ DwInitialize();
+
+ // Create a MessageWithAttachements
+
+ MessageWithAttachments msg;
+
+ // Create MIME-Version and Message-id header fields
+
+ msg.SetAutomaticFields();
+
+ // Set header fields
+
+ DwUint32 t = (DwUint32) time(NULL);
+ msg.SetDate(t);
+ msg.SetFrom("Emily Postnews <emily.postnews@usenet.com>");
+ msg.SetTo("verbose@noisy");
+ msg.SetCc("forgetful@myvax");
+ msg.SetBcc("eager@beaver.dam");
+ msg.SetSubject("Re: How long should my signature be?");
+
+ // Add text
+
+ DwString text = "Read the attached files\n";
+ msg.SetText(text);
+
+ // Add 7bit attachment
+
+ msg.Attach7bitFile("exampl05.txt");
+
+ // Add 8bit attachment
+
+ msg.Attach8bitFile("exampl05.txt");
+
+ // Add binary attachment
+
+ msg.AttachBinaryFile("exampl05.txt");
+
+ // Write it to a file
+
+ std::ofstream ostrm("exampl05.out");
+ ostrm << msg.AsString();
+
+ return 0;
+}
diff --git a/mimelib/test/exampl05.txt b/mimelib/test/exampl05.txt
new file mode 100644
index 000000000..88e0ba608
--- /dev/null
+++ b/mimelib/test/exampl05.txt
@@ -0,0 +1,34 @@
+> Dear Miss Postnews:
+>
+> How long should my signature be?
+>
+> -- verbose@noisy
+
+Dear Verbose:
+
+Please try and make your signature as long as you can. It's much more
+important than your article, of course, so try and have more lines of
+signature than actual text.
+
+Try and include a large graphic made of ASCII characters, plus lots of cute
+quotes and slogans. People will never tire of reading these pearls of wisdom
+again and again, and you will soon become personally associated with the joy
+each reader feels at seeing yet another delightful repeat of your signature.
+
+Be sure as well to include a complete map of USENET with each signature, to
+show how anybody can get mail to you from any site in the world. Be sure to
+include ARPA gateways as well. Also tell people on your own site how to mail
+to you. Give independent addresses for Internet, UUCP, BITNET, Arpanet and
+CSNET, even if they're all the same.
+
+Aside from your reply address, include your full name, company and
+organization. It's just common courtesy -- after all, in some newsreaders
+people have to type an *entire* keystroke to go back to the top of your
+article to see this information in the header.
+
+By all means include your phone number and street address in every single
+article. People are always responding to usenet articles with phone calls
+and letters. It would be silly to go to the extra trouble of including this
+information only in articles that need a response by conventional channels!
+
+Em