vmime icon indicating copy to clipboard operation
vmime copied to clipboard

How to get X-Envelope-To in vmime 0.9

Open jjohnson-airlink opened this issue 11 years ago • 0 comments

I have this code I am working on getting the X-Envelope-To as a string.

    if ( this->msg->getHeader()->hasField("X-Envelope-To") )
    {

        std::ostringstream oss_x_envelope;

        vmime::utility::outputStreamAdapter ossAdapter_x_envelope(oss_x_envelope);

        vmime::mailbox x_envelope_mbx = *this->msg->getHeader()->findField("X-Envelope-To")->getValue().dynamicCast <vmime::mailbox>();

        x_envelope_mbx.generate();          // if charset is windows-1251 this crashes

        x_envelope_mbx.generate(ossAdapter_x_envelope, vmime::lineLengthLimits::infinite, 0, NULL); // if charset is windows-1251 this crashes

        this->x_envelope_to = oss_x_envelope.str();
    }    

Is there an example of how to do this somewhere?

jjohnson-airlink avatar Apr 03 '14 22:04 jjohnson-airlink