diff options
Diffstat (limited to 'examples/example1.cpp')
-rw-r--r-- | examples/example1.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/examples/example1.cpp b/examples/example1.cpp index 8cd271d3..f5c5aae3 100644 --- a/examples/example1.cpp +++ b/examples/example1.cpp @@ -48,24 +48,24 @@ int main() mb.setExpeditor(vmime::mailbox("[email protected]")); vmime::addressList to; - to.appendAddress(new vmime::mailbox("[email protected]")); + to.appendAddress(vmime::create <vmime::mailbox>("[email protected]")); mb.setRecipients(to); vmime::addressList bcc; - bcc.appendAddress(new vmime::mailbox("[email protected]")); + bcc.appendAddress(vmime::create <vmime::mailbox>("[email protected]")); mb.setBlindCopyRecipients(bcc); mb.setSubject(vmime::text("My first message generated with vmime::messageBuilder")); // Message body - mb.getTextPart()->setText(vmime::stringContentHandler( + mb.getTextPart()->setText(vmime::create <vmime::stringContentHandler>( "I'm writing this short text to test message construction " \ "using the vmime::messageBuilder component.")); // Construction - vmime::message* msg = mb.construct(); + vmime::ref <vmime::message> msg = mb.construct(); // Raw text generation std::cout << "Generated message:" << std::endl; @@ -73,9 +73,6 @@ int main() vmime::utility::outputStreamAdapter out(std::cout); msg->generate(out); - - // Destruction - delete (msg); } // VMime exception catch (vmime::exception& e) |