diff options
author | Vincent Richard <[email protected]> | 2004-10-21 15:05:47 +0000 |
---|---|---|
committer | Vincent Richard <[email protected]> | 2004-10-21 15:05:47 +0000 |
commit | 2949fb51f13e1236d5c161f02e1c2c8541100e9f (patch) | |
tree | 991edcf50483116ce83977a4d9e652de8c5328dc /examples/example2.cpp | |
parent | header class unit tests added (diff) | |
download | vmime-2949fb51f13e1236d5c161f02e1c2c8541100e9f.tar.gz vmime-2949fb51f13e1236d5c161f02e1c2c8541100e9f.zip |
Refactoring (see ChangeLog).
Diffstat (limited to 'examples/example2.cpp')
-rw-r--r-- | examples/example2.cpp | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/examples/example2.cpp b/examples/example2.cpp index 183b6d02..6e7f81c6 100644 --- a/examples/example2.cpp +++ b/examples/example2.cpp @@ -45,14 +45,24 @@ int main() vmime::messageBuilder mb; // Fill in the basic fields - mb.expeditor() = vmime::mailbox("[email protected]"); - mb.recipients().append(vmime::mailbox("[email protected]")); - mb.blindCopyRecipients().append(vmime::mailbox("[email protected]")); - mb.subject() = vmime::text("My first message generated with vmime::messageBuilder"); + mb.setExpeditor(vmime::mailbox("[email protected]")); + + vmime::addressList to; + to.appendAddress(new vmime::mailbox("[email protected]")); + + mb.setRecipients(to); + + vmime::addressList bcc; + bcc.appendAddress(new vmime::mailbox("[email protected]")); + + mb.setBlindCopyRecipients(bcc); + + mb.setSubject(vmime::text("My first message generated with vmime::messageBuilder")); // Message body - mb.textPart().text() = "I'm writing this short text to test message construction " \ - "with attachment, using the vmime::messageBuilder component."; + mb.getTextPart()->setText(vmime::contentHandler( + "I'm writing this short text to test message construction " \ + "with attachment, using the vmime::messageBuilder component.")); // Adding an attachment vmime::fileAttachment* a = new vmime::fileAttachment @@ -62,8 +72,8 @@ int main() vmime::text("My first attachment") // description ); - a->fileInfo().setFilename("example2.cpp"); - a->fileInfo().setCreationDate(vmime::datetime("30 Apr 2003 14:30:00 +0200")); + a->getFileInfo().setFilename("example2.cpp"); + a->getFileInfo().setCreationDate(vmime::datetime("30 Apr 2003 14:30:00 +0200")); mb.attach(a); |