From 2949fb51f13e1236d5c161f02e1c2c8541100e9f Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Thu, 21 Oct 2004 15:05:47 +0000 Subject: Refactoring (see ChangeLog). --- examples/example2.cpp | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'examples/example2.cpp') 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("me@somewhere.com"); - mb.recipients().append(vmime::mailbox("you@elsewhere.com")); - mb.blindCopyRecipients().append(vmime::mailbox("you-bcc@nowhere.com")); - mb.subject() = vmime::text("My first message generated with vmime::messageBuilder"); + mb.setExpeditor(vmime::mailbox("me@somewhere.com")); + + vmime::addressList to; + to.appendAddress(new vmime::mailbox("you@elsewhere.com")); + + mb.setRecipients(to); + + vmime::addressList bcc; + bcc.appendAddress(new vmime::mailbox("you-bcc@nowhere.com")); + + 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); -- cgit v1.2.3