login about faq

First of all, great product! I love the Chilkat libraries and have been using them for quite a while now.

Unfortunately, I am now having some trouble with the Chilkat.Email class. It appears as though the BCC fields are not included in GetMime (and also GetMimeBinary). I am trying to persist a Chilkat email to disk by writing the bytes from GetMimeBinary and then reading them back in and using Email.SetFromMimeBytes to restore it to its initial state. However, when I do this, the BCC fields get stripped out of the email. If I run the following code:

        Dim chi As New Chilkat.Email
        chi.AddTo("Test", "test@hotmail.com")
        chi.AddBcc("Test", "test2@hotmail.com")
        MsgBox(chi.GetMime)
then it shows this:
        MIME-Version: 1.0
        Date: Mon, 16 Nov 2015 13:46:15 +1030
        Message-ID: 24AC72D1B6DBA501A1CC6F0ED0D921DAD96219D1@XPS-15
        Content-Type: text/plain
        Content-Transfer-Encoding: 7bit
        X-Priority: 3 (Normal)
        To: "Test" <test@hotmail.com>
Is this how it is supposed to work? If not, is there any way that it could be changed to include the BCC field?

asked Nov 16 '15 at 10:18

chilkat's gravatar image

chilkat ♦♦
11.8k316358420


Thanks. The difference between a "CC" recipient and a "BCC" recipient is that "BCC" is blind-carbon-copy. "blind" means that the other recipients should be unaware of the fact that the BCC recipients also received the email. If BCC is part of the MIME header, then it defeats this purpose -- because the BCC recipients can be seen.

If the application wants to persist the BCC addresses in the MIME, then a good solution is to add a header field containing the BCC recipients via the AddHeaderField method, and then call GetMime. For example:

        Dim chi As New Chilkat.Email
        chi.AddTo("Test", "test@hotmail.com")
        chi.AddBcc("Test", "test2@hotmail.com")
        chi.AddHeaderField("bcc_addrs","test2@hotmail.com")
        MsgBox(chi.GetMime)
When an app wants to load the MIME and send to the BCC addresses, it could do this:
        Dim chi As New Chilkat.Email
        chi.AddTo("Test", "test@hotmail.com")
        bccAddrs = chi.GetHeaderField("bcc_addrs")
        chi.RemoveHeaderField("bcc_addrs")
        chi.AddMultipleBcc(bccAddrs)
        ...

link

answered Nov 16 '15 at 10:29

chilkat's gravatar image

chilkat ♦♦
11.8k316358420

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×6

Asked: Nov 16 '15 at 10:18

Seen: 482 times

Last updated: Nov 16 '15 at 10:29

powered by OSQA