Sample code for 30+ languages & platforms
VB.NET 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 VB.NET Downloads

VB.NET
Dim success As Boolean = False

'  Assumes Chilkat is unlocked. See Global Unlock Sample.

Dim email As New Chilkat.Email
email.From = "Workshop team <events@example.com>"
success = email.AddTo("Alex Rivera","alex@example.net")
If (success <> True) Then
    Debug.WriteLine(email.LastErrorText)
    Exit Sub
End If

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

Dim i As Integer = 0
While (i < email.NumBcc)
    Debug.WriteLine("Envelope blind copy: " & email.GetBccAddr(i))
    i = i + 1
End While
'  Keep the original delivery list intact. Remove blind copies from the export.
Dim rendered As New Chilkat.BinData
success = email.GetMimeBd(rendered)
If (success <> True) Then
    Debug.WriteLine(email.LastErrorText)
    Exit Sub
End If

Dim copy As New Chilkat.Email
success = copy.SetFromMimeBd(rendered)
If (success <> True) Then
    Debug.WriteLine(copy.LastErrorText)
    Exit Sub
End If

copy.ClearBcc()
success = copy.SaveEml("shareable.eml")
If (success <> True) Then
    Debug.WriteLine(copy.LastErrorText)
    Exit Sub
End If

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