Florin Iucha wrote:
> Your code runs fine. Mine crashes, and the difference is... dumping the
> second header!

[SNIP]

> You can replace hdr->From() with hdr->To(), with no change in the observable
> behavior.

The problem is probably the fact that From() does not return the same
thing as a Subject(), which is only text.

To extract From, you need to do something like this:

std::cout << "From: " <<
hdr->From()->getValue().dynamicCast<vmime::mailbox>()->getName().getConvertedText(ch)
<< " <" <<
hdr->From()->getValue().dynamicCast<vmime::mailbox>()->getEmail() << ">"
<< std::endl;

This should fix the segfault. If you take a look at the docs you'll see
that To and Cc also require special treatment, as they contain an array
of addresses.

Regards,

-- 
Mattias Nordstrom


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to