Sample code for 30+ languages & platforms
B4X Requires Chilkat v11.0.0+

Inspect blind-copy recipients and prepare a shareable copy

See more Email Object Examples

Keep the addressed Email object for SMTP submission. When exporting a copy to share, clear its Bcc collection before saving. Treat intermediate MIME buffers as private because a renderer can preserve blind-copy details.

Chilkat B4X Downloads

B4X
Dim success As Boolean = False

'  Assumes Chilkat is unlocked. See Global Unlock Sample.

Dim email As ChilkatEmail
email.Initialize
email.From = "Workshop team <events@example.com>"
success = email.AddTo("Alex Rivera", "alex@example.net")
If success <> True Then
    Log(email.LastErrorText)
    Return
End If

email.Subject = "Workshop registration"
email.Body = "Your workshop confirmation."
success = email.AddBcc("Archive", "archive@example.com")
If success <> True Then
    Log(email.LastErrorText)
    Return
End If

Dim i As Int = 0
Do While (i < email.NumBcc)
    Log("Envelope blind copy: " & email.GetBccAddr(i))
    i = i + 1
Loop
'  Keep the original delivery list intact. Remove blind copies from the export.
Dim rendered As ChilkatBinData
rendered.Initialize
success = email.GetMimeBd(rendered)
If success <> True Then
    Log(email.LastErrorText)
    Return
End If

Dim copy As ChilkatEmail
copy.Initialize
success = copy.SetFromMimeBd(rendered)
If success <> True Then
    Log(copy.LastErrorText)
    Return
End If

copy.ClearBcc
success = copy.SaveEml("shareable.eml")
If success <> True Then
    Log(copy.LastErrorText)
    Return
End If

Log("Bcc entries in shareable copy: " & copy.NumBcc)